mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-29 02:30:03 +00:00
feat(fileSync): auto update path with file name if none is given
This commit is contained in:
parent
28221df151
commit
2bf04b4e56
1 changed files with 9 additions and 0 deletions
|
|
@ -125,6 +125,15 @@ export const SYNC_FORM: ConfigFormSection<SyncConfig> = {
|
|||
required: true,
|
||||
label: T.F.SYNC.FORM.LOCAL_FILE.L_SYNC_FILE_PATH,
|
||||
description: T.F.SYNC.FORM.LOCAL_FILE.L_SYNC_FILE_PATH_DESCRIPTION,
|
||||
change: (field) => {
|
||||
const lastChar = field?.model.syncFilePath?.trim().slice(-1);
|
||||
if (lastChar === '/' || lastChar === '\\') {
|
||||
field.formControl?.setValue(
|
||||
(field.model.syncFilePath += 'SP_SYNC_FILE.json'),
|
||||
);
|
||||
field.formControl?.updateValueAndValidity();
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue