Fix:User toJSONForPublic method

This commit is contained in:
advplyr 2022-11-13 08:25:51 -06:00
parent bcc7fcb645
commit 42050a5f17

View File

@ -130,8 +130,8 @@ class User {
toJSONForPublic(sessions, libraryItems) { toJSONForPublic(sessions, libraryItems) {
var userSession = sessions ? sessions.find(s => s.userId === this.id) : null var userSession = sessions ? sessions.find(s => s.userId === this.id) : null
var session = null var session = null
if (session) { if (userSession) {
var libraryItem = libraryItems.find(li => li.id === session.libraryItemId) var libraryItem = libraryItems.find(li => li.id === userSession.libraryItemId)
if (libraryItem) { if (libraryItem) {
session = userSession.toJSONForClient(libraryItem) session = userSession.toJSONForClient(libraryItem)
} }