diff --git a/packages/backend/src/server/api/endpoints/i/update.ts b/packages/backend/src/server/api/endpoints/i/update.ts index f0e8dfc832..8e61b8f784 100644 --- a/packages/backend/src/server/api/endpoints/i/update.ts +++ b/packages/backend/src/server/api/endpoints/i/update.ts @@ -588,12 +588,12 @@ export default class extends Endpoint { // eslint- // `ApRendererService.renderPerson` private userNeedsPublishing(oldUser: MiLocalUser, newUser: Partial): boolean { for (const field of ['avatarId', 'bannerId', 'backgroundId', 'isBot', 'username', 'name', 'isLocked', 'isExplorable', 'isCat', 'noindex', 'speakAsCat', 'movedToUri', 'alsoKnownAs'] as (keyof MiUser)[]) { - if (newUser.hasOwnProperty(field) && oldUser[field] !== newUser[field]) { + if ((field in newUser) && oldUser[field] !== newUser[field]) { return true; } } for (const arrayField of ['emojis', 'tags'] as (keyof MiUser)[]) { - if (newUser.hasOwnProperty(arrayField) !== oldUser.hasOwnProperty(arrayField)) { + if ((arrayField in newUser) !== (arrayField in oldUser)) { return true; } @@ -611,12 +611,12 @@ export default class extends Endpoint { // eslint- private profileNeedsPublishing(oldProfile: MiUserProfile, newProfile: Partial): boolean { for (const field of ['description', 'followedMessage', 'birthday', 'location', 'listenbrainz'] as (keyof MiUserProfile)[]) { - if (newProfile.hasOwnProperty(field) && oldProfile[field] !== newProfile[field]) { + if ((field in newProfile) && oldProfile[field] !== newProfile[field]) { return true; } } for (const arrayField of ['fields'] as (keyof MiUserProfile)[]) { - if (newProfile.hasOwnProperty(arrayField) !== oldProfile.hasOwnProperty(arrayField)) { + if ((arrayField in newProfile) !== (arrayField in oldProfile)) { return true; }