mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-05 19:59:20 +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,
|
setLocalStorageItem,
|
||||||
useLocalStorage,
|
useLocalStorage,
|
||||||
} from "../useLocalStorage";
|
} from "../useLocalStorage";
|
||||||
|
import { useEnableEmbeddedE2EE } from "../e2ee/e2eeHooks";
|
||||||
|
|
||||||
type Setting<T> = [T, (value: T) => void];
|
type Setting<T> = [T, (value: T) => void];
|
||||||
type DisableableSetting<T> = [T, ((value: T) => void) | null];
|
type DisableableSetting<T> = [T, ((value: T) => void) | null];
|
||||||
@@ -90,11 +91,13 @@ export const useOptInAnalytics = (): DisableableSetting<boolean | null> => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const useEnableSPAE2EE = (): DisableableSetting<boolean | null> => {
|
export const useEnableSPAE2EE = (): DisableableSetting<boolean | null> => {
|
||||||
|
const embeddedE2EEEnabled = useEnableEmbeddedE2EE();
|
||||||
const settingVal = useSetting<boolean | null>(
|
const settingVal = useSetting<boolean | null>(
|
||||||
"enable-end-to-end-encryption",
|
"enable-end-to-end-encryption",
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (embeddedE2EEEnabled) return [false, null];
|
||||||
if (!isE2EESupported()) return [false, null];
|
if (!isE2EESupported()) return [false, null];
|
||||||
|
|
||||||
return settingVal;
|
return settingVal;
|
||||||
|
|||||||
Reference in New Issue
Block a user