Skip to content

Commit

Permalink
fix: replace === by utils.equalArray in a comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
francisco-tanker authored and JMounier committed Sep 2, 2022
1 parent bc02b8f commit e4e0ff0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/src/Users/User.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { utils } from '@tanker/crypto';
import { InternalError } from '@tanker/errors';

import type { DeviceCreationEntry } from './Serialize';
Expand All @@ -19,7 +20,7 @@ export function applyDeviceCreationToUser(deviceCreation: DeviceCreationEntry, u
};

for (const existingDev of oldDevices) {
if (existingDev.deviceId === newDevice.deviceId)
if (utils.equalArray(existingDev.deviceId, newDevice.deviceId))
throw new InternalError('Assertion error: Adding an already existing device.');
}

Expand Down

0 comments on commit e4e0ff0

Please sign in to comment.