Merge pull request #1310 from vector-im/SimonBrandner/feat/disable-e2e
This commit is contained in:
@@ -40,6 +40,7 @@
|
|||||||
"Element Call Home": "Element Call Home",
|
"Element Call Home": "Element Call Home",
|
||||||
"Element Call is temporarily not end-to-end encrypted while we test scalability.": "Element Call is temporarily not end-to-end encrypted while we test scalability.",
|
"Element Call is temporarily not end-to-end encrypted while we test scalability.": "Element Call is temporarily not end-to-end encrypted while we test scalability.",
|
||||||
"Enable end-to-end encryption (password protected calls)": "Enable end-to-end encryption (password protected calls)",
|
"Enable end-to-end encryption (password protected calls)": "Enable end-to-end encryption (password protected calls)",
|
||||||
|
"End-to-end encryption isn't supported on your browser.": "End-to-end encryption isn't supported on your browser.",
|
||||||
"Exit full screen": "Exit full screen",
|
"Exit full screen": "Exit full screen",
|
||||||
"Expose developer settings in the settings window.": "Expose developer settings in the settings window.",
|
"Expose developer settings in the settings window.": "Expose developer settings in the settings window.",
|
||||||
"Feedback": "Feedback",
|
"Feedback": "Feedback",
|
||||||
|
|||||||
@@ -262,10 +262,15 @@ export const SettingsModal = (props: Props) => {
|
|||||||
id="enableE2EE"
|
id="enableE2EE"
|
||||||
name="end-to-end-encryption"
|
name="end-to-end-encryption"
|
||||||
label={t("Enable end-to-end encryption (password protected calls)")}
|
label={t("Enable end-to-end encryption (password protected calls)")}
|
||||||
|
description={
|
||||||
|
!setEnableE2EE &&
|
||||||
|
t("End-to-end encryption isn't supported on your browser.")
|
||||||
|
}
|
||||||
|
disabled={!setEnableE2EE}
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
checked={enableE2EE}
|
checked={enableE2EE ?? undefined}
|
||||||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||||
setEnableE2EE(e.target.checked)
|
setEnableE2EE?.(e.target.checked)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</FieldRow>
|
</FieldRow>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ limitations under the License.
|
|||||||
|
|
||||||
import { EventEmitter } from "events";
|
import { EventEmitter } from "events";
|
||||||
import { useMemo, useState, useEffect, useCallback } from "react";
|
import { useMemo, useState, useEffect, useCallback } from "react";
|
||||||
|
import { isE2EESupported } from "livekit-client";
|
||||||
|
|
||||||
import { PosthogAnalytics } from "../analytics/PosthogAnalytics";
|
import { PosthogAnalytics } from "../analytics/PosthogAnalytics";
|
||||||
|
|
||||||
@@ -98,15 +99,22 @@ export const useOptInAnalytics = (): DisableableSetting<boolean | null> => {
|
|||||||
return [false, 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 = () =>
|
export const useDeveloperSettingsTab = () =>
|
||||||
useSetting("developer-settings-tab", false);
|
useSetting("developer-settings-tab", false);
|
||||||
|
|
||||||
export const useShowConnectionStats = () =>
|
export const useShowConnectionStats = () =>
|
||||||
useSetting("show-connection-stats", false);
|
useSetting("show-connection-stats", false);
|
||||||
|
|
||||||
export const useEnableE2EE = () =>
|
|
||||||
useSetting("enable-end-to-end-encryption", false);
|
|
||||||
|
|
||||||
export const useDefaultDevices = () =>
|
export const useDefaultDevices = () =>
|
||||||
useSetting("defaultDevices", {
|
useSetting("defaultDevices", {
|
||||||
audioinput: "",
|
audioinput: "",
|
||||||
|
|||||||
Reference in New Issue
Block a user