Reset overwrite url if it is invalid (does fail to reach sfu)

This commit is contained in:
Timo K
2025-11-27 15:06:36 +01:00
parent 90d4b6a6ce
commit bd3e91738e
4 changed files with 45 additions and 10 deletions

View File

@@ -41,6 +41,7 @@ import {
matrixRTCMode as matrixRTCModeSetting,
customLivekitUrl as customLivekitUrlSetting,
MatrixRTCMode,
useSettingWithLastUpdateReason,
} from "./settings";
import type { Room as LivekitRoom } from "livekit-client";
import styles from "./DeveloperSettingsTab.module.css";
@@ -92,9 +93,8 @@ export const DeveloperSettingsTab: FC<Props> = ({
alwaysShowIphoneEarpieceSetting,
);
const [customLivekitUrl, setCustomLivekitUrl] = useSetting(
customLivekitUrlSetting,
);
const [customLivekitUrl, setCustomLivekitUrl, customLivekitUrlUpdateReason] =
useSettingWithLastUpdateReason(customLivekitUrlSetting);
const [customLivekitUrlTextBuffer, setCustomLivekitUrlTextBuffer] =
useState(customLivekitUrl);
useEffect(() => {
@@ -220,7 +220,8 @@ export const DeveloperSettingsTab: FC<Props> = ({
onSubmit={(e) => e.preventDefault()}
helpLabel={
customLivekitUrl === null
? t("developer_mode.custom_livekit_url.from_config")
? t("developer_mode.custom_livekit_url.from_config") +
(customLivekitUrlUpdateReason ?? "")
: t("developer_mode.custom_livekit_url.current_url") +
customLivekitUrl
}