@@ -6,8 +6,6 @@ import { useMemo } from 'react';
66import { useTranslation } from 'react-i18next' ;
77
88import { OtrRoomState } from '../../../app/otr/lib/OtrRoomState' ;
9- import { E2EEState } from '../../lib/e2ee/E2EEState' ;
10- import { E2ERoomState } from '../../lib/e2ee/E2ERoomState' ;
119import { getRoomTypeTranslation } from '../../lib/getRoomTypeTranslation' ;
1210import { useRoom , useRoomSubscription } from '../../views/room/contexts/RoomContext' ;
1311import type { RoomToolboxActionConfig } from '../../views/room/contexts/RoomToolboxContext' ;
@@ -23,7 +21,7 @@ export const useE2EERoomAction = () => {
2321 const subscription = useRoomSubscription ( ) ;
2422 const e2eeState = useE2EEState ( ) ;
2523 const e2eeRoomState = useE2EERoomState ( room . _id ) ;
26- const isE2EEReady = e2eeState === E2EEState . READY || e2eeState === E2EEState . SAVE_PASSWORD ;
24+ const isE2EEReady = e2eeState === ' READY' || e2eeState === ' SAVE_PASSWORD' ;
2725 const readyToEncrypt = isE2EEReady || room . encrypted ;
2826 const permittedToToggleEncryption = usePermission ( 'toggle-room-e2e-encryption' , room . _id ) ;
2927 const permittedToEditRoom = usePermission ( 'edit-room' , room . _id ) ;
@@ -34,13 +32,7 @@ export const useE2EERoomAction = () => {
3432 const { otrState } = useOTR ( ) ;
3533
3634 const isE2EERoomNotReady = ( ) => {
37- if (
38- e2eeRoomState === E2ERoomState . NO_PASSWORD_SET ||
39- e2eeRoomState === E2ERoomState . NOT_STARTED ||
40- e2eeRoomState === E2ERoomState . DISABLED ||
41- e2eeRoomState === E2ERoomState . ERROR ||
42- e2eeRoomState === E2ERoomState . WAITING_KEYS
43- ) {
35+ if ( e2eeRoomState === 'NOT_STARTED' || e2eeRoomState === 'DISABLED' || e2eeRoomState === 'ERROR' || e2eeRoomState === 'WAITING_KEYS' ) {
4436 return true ;
4537 }
4638
0 commit comments