Disable E2EE settings on unsupported browsers

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner
2023-07-26 15:46:08 +02:00
parent b5e1752e06
commit 7bee0de014
2 changed files with 18 additions and 5 deletions

View File

@@ -16,6 +16,7 @@ limitations under the License.
import { EventEmitter } from "events";
import { useMemo, useState, useEffect, useCallback } from "react";
import { isE2EESupported } from "livekit-client";
import { PosthogAnalytics } from "../analytics/PosthogAnalytics";
@@ -98,15 +99,22 @@ export const useOptInAnalytics = (): DisableableSetting<boolean | null> => {
return [false, null];
};
export const useEnableE2EE = (): DisableableSetting<boolean | null> => {
const settingVal = useSetting<boolean | null>(
"enable-end-to-end-encryption",
false
);
if (isE2EESupported()) return settingVal;
return [false, null];
};
export const useDeveloperSettingsTab = () =>
useSetting("developer-settings-tab", false);
export const useShowConnectionStats = () =>
useSetting("show-connection-stats", false);
export const useEnableE2EE = () =>
useSetting("enable-end-to-end-encryption", false);
export const useDefaultDevices = () =>
useSetting("defaultDevices", {
audioinput: "",