mirror of
https://github.com/vector-im/element-call.git
synced 2026-10-16 23:45:50 +00:00
Avoid null in transport dev setting
This commit is contained in:
@@ -70,6 +70,7 @@ import { useUrlParams } from "../UrlParams";
|
|||||||
import { useBehavior } from "../useBehavior";
|
import { useBehavior } from "../useBehavior";
|
||||||
import { type ViewModel } from "../state/ViewModel.ts";
|
import { type ViewModel } from "../state/ViewModel.ts";
|
||||||
import { getSFUConfig } from "../livekit/auth/index.ts";
|
import { getSFUConfig } from "../livekit/auth/index.ts";
|
||||||
|
import { type UnstableLivekitTransport } from "matrix-js-sdk/lib/matrixrtc";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The state of MatrixRTC's media key rotation.
|
* The state of MatrixRTC's media key rotation.
|
||||||
@@ -174,10 +175,10 @@ export const DeveloperSettingsTab: FC<Props> = ({
|
|||||||
customTransportSetting,
|
customTransportSetting,
|
||||||
);
|
);
|
||||||
const [customTransportTextBuffer, setCustomLivekitUrlTextBuffer] = useState(
|
const [customTransportTextBuffer, setCustomLivekitUrlTextBuffer] = useState(
|
||||||
() => JSON.stringify(customTransport),
|
() => transportText(customTransport),
|
||||||
);
|
);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setCustomLivekitUrlTextBuffer(JSON.stringify(customTransport));
|
setCustomLivekitUrlTextBuffer(transportText(customTransport));
|
||||||
}, [customTransport]);
|
}, [customTransport]);
|
||||||
|
|
||||||
const [muteAllAudio, setMuteAllAudio] = useSetting(muteAllAudioSetting);
|
const [muteAllAudio, setMuteAllAudio] = useSetting(muteAllAudioSetting);
|
||||||
@@ -703,3 +704,10 @@ export const DeveloperSettingsTab: FC<Props> = ({
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The text shown in the custom transport field for a given setting value.
|
||||||
|
*/
|
||||||
|
function transportText(transport: UnstableLivekitTransport | null): string {
|
||||||
|
return transport === null ? "" : JSON.stringify(transport);
|
||||||
|
}
|
||||||
|
|||||||
@@ -250,7 +250,7 @@ exports[`DeveloperSettingsTab > renders and matches snapshot 1`] = `
|
|||||||
id="radix-_r_7_"
|
id="radix-_r_7_"
|
||||||
name="input"
|
name="input"
|
||||||
title=""
|
title=""
|
||||||
value="null"
|
value=""
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<span
|
<span
|
||||||
|
|||||||
Reference in New Issue
Block a user