Skip to content

Commit

Permalink
fix: e2eRoom.resetRoomKey() return at useE2EEResetRoomKeyRoom
Browse files Browse the repository at this point in the history
  • Loading branch information
hugocostadev authored and KevLehman committed Oct 11, 2024
1 parent d256756 commit a5903b1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apps/meteor/client/views/room/hooks/useE2EEResetRoomKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ export const useE2EEResetRoomKeyRoom = (
return useMutation(async ({ roomId }) => {
const e2eRoom = await e2e.getInstanceByRoomId(roomId);
if (!e2eRoom) {
return;
throw new Error('Cannot reset room key');
}

const { e2eKey, e2eKeyId } = await e2eRoom.resetRoomKey();
const { e2eKey, e2eKeyId } = (await e2eRoom.resetRoomKey()) ?? {};

if (!e2eKey) {
if (!e2eKey || !e2eKeyId) {
throw new Error('Cannot reset room key');
}

Expand Down

0 comments on commit a5903b1

Please sign in to comment.