admin/config: "nothing to save" message

Massimo Melina committed May 6, 2022 at 10:34 UTC b8b0e84ead7d50a1f00ca8d2a1071505725f772b
1 file changed +3
admin/src/ConfigPage.ts
+3
@@ -12,6 +12,7 @@ import StringStringField from './StringStringField'
12 import FileField from './FileField'
13 import { alertDialog, closeDialog, confirmDialog, formDialog, newDialog, toast, waitDialog } from './dialog'
14 import { proxyWarning } from './HomePage'
15 +import _ from 'lodash';
16
17 let loaded: Dict | undefined
18 let exposedReloadStatus: undefined | (() => void)
@@ -117,6 +118,8 @@ export default function ConfigPage() {
118
119 async function save() {
120 const values = state.changes
121 + if (_.isEmpty(values))
122 + return toast("Nothing to save")
123 const loc = window.location
124 const newPort = loc.protocol === 'http:' ? values.port : values.https_port
125 if (newPort <= 0 && !await confirmDialog("You are switching off the server port and you will be disconnected"))