admin/config: warn user of disconnection caused by certificate changes

Massimo Melina committed Apr 9, 2022 at 18:06 UTC 667566f00eb70c1f9615d5f84fb9abc91955d12c
1 file changed +2
admin/src/ConfigPage.ts
+2
@@ -115,6 +115,8 @@ export default function ConfigPage() {
115 return
116 else if (newPort > 0 && !await confirmDialog("You are changing the port and you may be disconnected"))
117 return
118 + if (loc.protocol === 'https:' && ('cert' in values || 'private_key' in values) && !await confirmDialog("You may disrupt https service, kicking you out"))
119 + return
120 await apiCall('set_config', { values })
121 if (newPort > 0) {
122 await alertDialog("You are being redirected but in some cases this may fail. Hold on tight!", 'warning')