Improve code readability
This commit is contained in:
parent
1af51fc129
commit
af30991d77
|
@ -750,10 +750,16 @@ async function handleTagImport(character, { importAll = false, importExisting =
|
||||||
const folderTags = getOpenBogusFolders();
|
const folderTags = getOpenBogusFolders();
|
||||||
|
|
||||||
// Choose the setting for this dialog. If from settings, verify the setting really exists, otherwise take "ASK".
|
// Choose the setting for this dialog. If from settings, verify the setting really exists, otherwise take "ASK".
|
||||||
const setting = forceShow ? tag_import_setting.ASK
|
let setting;
|
||||||
: importAll ? tag_import_setting.ALL
|
if (forceShow) {
|
||||||
: importExisting ? tag_import_setting.ONLY_EXISTING
|
setting = tag_import_setting.ASK;
|
||||||
: Object.values(tag_import_setting).find(setting => setting === power_user.tag_import_setting) ?? tag_import_setting.ASK;
|
} else if (importAll) {
|
||||||
|
setting = tag_import_setting.ALL;
|
||||||
|
} else if (importExisting) {
|
||||||
|
setting = tag_import_setting.ONLY_EXISTING;
|
||||||
|
} else {
|
||||||
|
setting = Object.values(tag_import_setting).find(setting => setting === power_user.tag_import_setting) ?? tag_import_setting.ASK;
|
||||||
|
}
|
||||||
|
|
||||||
switch (setting) {
|
switch (setting) {
|
||||||
case tag_import_setting.ALL:
|
case tag_import_setting.ALL:
|
||||||
|
|
Loading…
Reference in New Issue