...
User comparison for both Server/DC/Cloud:
Code Block | ||
---|---|---|
| ||
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; } |