mirror of
https://github.com/vector-im/element-call.git
synced 2024-11-15 00:04:59 +08:00
Hide E2EE behind a flag
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
26bc897233
commit
fa2fcbcbec
@ -27,6 +27,7 @@ import { useLocationNavigation } from "../useLocationNavigation";
|
||||
import { MatrixInfo, VideoPreview } from "./VideoPreview";
|
||||
import { E2EEConfig, UserChoices } from "../livekit/useLiveKit";
|
||||
import { InputField } from "../input/Input";
|
||||
import { useEnableE2EE } from "../settings/useSetting";
|
||||
|
||||
interface Props {
|
||||
matrixInfo: MatrixInfo;
|
||||
@ -40,6 +41,8 @@ export function LobbyView(props: Props) {
|
||||
const { t } = useTranslation();
|
||||
useLocationNavigation();
|
||||
|
||||
const [enableE2EE] = useEnableE2EE();
|
||||
|
||||
const joinCallButtonRef = useRef<HTMLButtonElement>(null);
|
||||
useEffect(() => {
|
||||
if (joinCallButtonRef.current) {
|
||||
@ -80,13 +83,15 @@ export function LobbyView(props: Props) {
|
||||
matrixInfo={props.matrixInfo}
|
||||
onUserChoicesChanged={setUserChoices}
|
||||
/>
|
||||
<InputField
|
||||
className={styles.passwordField}
|
||||
label={t("Password (if none E2EE, is disabled)")}
|
||||
type="text"
|
||||
onChange={onE2EESharedKeyChanged}
|
||||
value={e2eeSharedKey}
|
||||
/>
|
||||
{enableE2EE && (
|
||||
<InputField
|
||||
className={styles.passwordField}
|
||||
label={t("Password (if none E2EE, is disabled)")}
|
||||
type="text"
|
||||
onChange={onE2EESharedKeyChanged}
|
||||
value={e2eeSharedKey}
|
||||
/>
|
||||
)}
|
||||
<Trans>
|
||||
<Button
|
||||
ref={joinCallButtonRef}
|
||||
|
@ -34,6 +34,7 @@ import {
|
||||
useOptInAnalytics,
|
||||
useDeveloperSettingsTab,
|
||||
useShowConnectionStats,
|
||||
useEnableE2EE,
|
||||
} from "./useSetting";
|
||||
import { FieldRow, InputField } from "../input/Input";
|
||||
import { Button } from "../button";
|
||||
@ -68,6 +69,7 @@ export const SettingsModal = (props: Props) => {
|
||||
useDeveloperSettingsTab();
|
||||
const [showConnectionStats, setShowConnectionStats] =
|
||||
useShowConnectionStats();
|
||||
const [enableE2EE, setEnableE2EE] = useEnableE2EE();
|
||||
|
||||
const downloadDebugLog = useDownloadDebugLog();
|
||||
|
||||
@ -249,6 +251,18 @@ export const SettingsModal = (props: Props) => {
|
||||
}
|
||||
/>
|
||||
</FieldRow>
|
||||
<FieldRow>
|
||||
<InputField
|
||||
id="enableE2EE"
|
||||
name="end-to-end-encryption"
|
||||
label={t("Enable end-to-end encryption (password protected calls)")}
|
||||
type="checkbox"
|
||||
checked={enableE2EE}
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||
setEnableE2EE(e.target.checked)
|
||||
}
|
||||
/>
|
||||
</FieldRow>
|
||||
<FieldRow>
|
||||
<Button onPress={downloadDebugLog}>{t("Download debug logs")}</Button>
|
||||
</FieldRow>
|
||||
|
@ -104,6 +104,9 @@ export const useDeveloperSettingsTab = () =>
|
||||
export const useShowConnectionStats = () =>
|
||||
useSetting("show-connection-stats", false);
|
||||
|
||||
export const useEnableE2EE = () =>
|
||||
useSetting("enable-end-to-end-encryption", false);
|
||||
|
||||
export const useDefaultDevices = () =>
|
||||
useSetting("defaultDevices", {
|
||||
audioinput: "",
|
||||
|
Loading…
Reference in New Issue
Block a user