mirror of
https://github.com/vector-im/element-call.git
synced 2026-04-03 07:10:26 +00:00
Fix useEnableSPAE2EE
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
@@ -23,6 +23,7 @@ import {
|
||||
setLocalStorageItem,
|
||||
useLocalStorage,
|
||||
} from "../useLocalStorage";
|
||||
import { useEnableEmbeddedE2EE } from "../e2ee/e2eeHooks";
|
||||
|
||||
type Setting<T> = [T, (value: T) => void];
|
||||
type DisableableSetting<T> = [T, ((value: T) => void) | null];
|
||||
@@ -90,11 +91,13 @@ export const useOptInAnalytics = (): DisableableSetting<boolean | null> => {
|
||||
};
|
||||
|
||||
export const useEnableSPAE2EE = (): DisableableSetting<boolean | null> => {
|
||||
const embeddedE2EEEnabled = useEnableEmbeddedE2EE();
|
||||
const settingVal = useSetting<boolean | null>(
|
||||
"enable-end-to-end-encryption",
|
||||
true
|
||||
);
|
||||
|
||||
if (embeddedE2EEEnabled) return [false, null];
|
||||
if (!isE2EESupported()) return [false, null];
|
||||
|
||||
return settingVal;
|
||||
|
||||
Reference in New Issue
Block a user