From c9f9ff857e7180994bd75c91fdc850ac418f39e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mats=20T=C3=B6rnberg?= Date: Tue, 22 Sep 2026 16:39:20 +0200 Subject: [PATCH] add mobile ICE settings reset --- public/app.js | 14 ++++++++++++-- public/index.html | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/public/app.js b/public/app.js index e1a8efe..3150154 100644 --- a/public/app.js +++ b/public/app.js @@ -2074,10 +2074,20 @@ $('#ice-cancel').onclick = () => $('#modal-backdrop').classList.add('hidden'); $('#modal-backdrop').onclick = (ev) => { if (ev.target === $('#modal-backdrop')) $('#modal-backdrop').classList.add('hidden'); }; -$('#ice-reset').onclick = () => { +function resetIceSettings(reload = false) { localStorage.removeItem(LS_ICE); $('#override-enabled').checked = false; - fetchIce().then((server) => { $('#ice-json').value = JSON.stringify(server, null, 2); }); + fetchIce().then((server) => { + $('#ice-json').value = JSON.stringify(server, null, 2); + if (reload) location.reload(); + }).catch(() => { + if (reload) location.reload(); + }); +} +$('#ice-reset').onclick = () => resetIceSettings(); +$('#btn-reset-ice-mobile').onclick = () => { + toast('Resetting saved ICE settings…', 'ok'); + resetIceSettings(true); }; $('#ice-save').onclick = () => { const enabled = $('#override-enabled').checked; diff --git a/public/index.html b/public/index.html index 5782710..dd357f7 100644 --- a/public/index.html +++ b/public/index.html @@ -126,6 +126,7 @@ +