mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-02 10:57:45 +01:00
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();
|
||||
|
||||
// Choose the setting for this dialog. If from settings, verify the setting really exists, otherwise take "ASK".
|
||||
const setting = forceShow ? tag_import_setting.ASK
|
||||
: importAll ? tag_import_setting.ALL
|
||||
: importExisting ? tag_import_setting.ONLY_EXISTING
|
||||
: Object.values(tag_import_setting).find(setting => setting === power_user.tag_import_setting) ?? tag_import_setting.ASK;
|
||||
let setting;
|
||||
if (forceShow) {
|
||||
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) {
|
||||
case tag_import_setting.ALL:
|
||||
|
Loading…
x
Reference in New Issue
Block a user