fix: adding confirmation modal to confirm gateway url change
This commit is contained in:
parent
4a9c921168
commit
2b1c822b01
@ -98,7 +98,12 @@ export function applySettingsFromUrl(host: SettingsHost) {
|
|||||||
if (gatewayUrlRaw != null) {
|
if (gatewayUrlRaw != null) {
|
||||||
const gatewayUrl = gatewayUrlRaw.trim();
|
const gatewayUrl = gatewayUrlRaw.trim();
|
||||||
if (gatewayUrl && gatewayUrl !== host.settings.gatewayUrl) {
|
if (gatewayUrl && gatewayUrl !== host.settings.gatewayUrl) {
|
||||||
applySettings(host, { ...host.settings, gatewayUrl });
|
const confirmed = window.confirm(
|
||||||
|
`Change gateway URL to:\n${gatewayUrl}\n\nThis will reconnect to a different gateway server. Only confirm if you trust this URL.`,
|
||||||
|
);
|
||||||
|
if (confirmed) {
|
||||||
|
applySettings(host, { ...host.settings, gatewayUrl });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
params.delete("gatewayUrl");
|
params.delete("gatewayUrl");
|
||||||
shouldCleanUrl = true;
|
shouldCleanUrl = true;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user