Skip to content

Commit c243e12

Browse files
committed
fix(panel): pre-process the dataPath in settings for comparison consistency
Since on the backend it was going to be slash(normalize()), after saving it would still show the state of "pending save" as the browser might be using backslashes while the saved version had forward slashes.
1 parent 7185f6c commit c243e12

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

panel/src/pages/Settings/tabCards/fxserver.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,13 @@ export default function ConfigCardFxserver({ cardCtx, pageCtx }: SettingsCardPro
232232
if (startupArgsRef.current) {
233233
currStartupArgs = inputArrayUtil.toCfg(startupArgsRef.current.value);
234234
}
235+
let currDataPath;
236+
if (dataPathRef.current?.value) {
237+
currDataPath = dataPathRef.current.value.replace(/\\/g, '/').replace(/\/\/+/, '/');
238+
if (currDataPath.endsWith('/')) {
239+
currDataPath = currDataPath.slice(0, -1);
240+
}
241+
}
235242
const res = processConfigStates([
236243
[dataPath, dataPathRef.current?.value],
237244
[restarterSchedule, restarterSchedule.state.value],

0 commit comments

Comments
 (0)