diff --git a/frontend/service-settings.html b/frontend/service-settings.html index 7ca53f7..bd0fd68 100644 --- a/frontend/service-settings.html +++ b/frontend/service-settings.html @@ -16,7 +16,7 @@ -
+

Loading...

@@ -78,7 +78,7 @@ diff --git a/frontend/settings.html b/frontend/settings.html index 2e7ef87..3ecc41d 100644 --- a/frontend/settings.html +++ b/frontend/settings.html @@ -17,7 +17,7 @@ - +

Settings

diff --git a/frontend/ts/service-settings.ts b/frontend/ts/service-settings.ts index 5b0ed7c..bbe591c 100644 --- a/frontend/ts/service-settings.ts +++ b/frontend/ts/service-settings.ts @@ -65,6 +65,11 @@ document.addEventListener('DOMContentLoaded', () => { remote.getCurrentWindow().close(); }); + document.querySelector('form')?.addEventListener('submit', e => { + e.preventDefault(); + save(); + }); + ipcRenderer.send('sync-settings'); document.getElementById('userAgentAutoFill')?.addEventListener('click', () => { @@ -170,7 +175,7 @@ function loadServiceValues() { } } -(window as any).save = () => { +function save() { let form = document.querySelector('form'); if (!form) return; const formData = new FormData(form); diff --git a/frontend/ts/settings.ts b/frontend/ts/settings.ts index 2d017c9..bc14c8d 100644 --- a/frontend/ts/settings.ts +++ b/frontend/ts/settings.ts @@ -36,7 +36,7 @@ ipcRenderer.on('updateStatus', (e, available, version) => { } }); -(window as any).save = () => { +function save() { let form = document.querySelector('form'); if (!form) return; const formData = new FormData(form); @@ -71,6 +71,11 @@ document.addEventListener('DOMContentLoaded', () => { remote.getCurrentWindow().close(); }); + document.querySelector('form')?.addEventListener('submit', e => { + e.preventDefault(); + save(); + }); + ipcRenderer.send('syncSettings'); ipcRenderer.send('checkForUpdates'); }); \ No newline at end of file