Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

User comparison for both Server/DC/Cloud:

Code Block
languagejs
const isSameUser = (user1, user2) => {
    if (!user1 || !user2) return false;
    if (Object.hasOwn(user1, 'key') && Object.hasOwn(user2, 'key'))
      return user1.key === user2.key;
    if (Object.hasOwn(user1, 'accountId') && Object.hasOwn(user2, 'accountId'))
      return user1.accountId === user2.accountId;

    return false;
}