From b2f54406e24054fcaa340952514d6d910268d1dd Mon Sep 17 00:00:00 2001 From: Khai Truong Date: Tue, 5 Nov 2024 11:58:47 +0700 Subject: [PATCH] Update dictionary alias if it is the same as title --- ext/js/pages/settings/dictionary-import-controller.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/js/pages/settings/dictionary-import-controller.js b/ext/js/pages/settings/dictionary-import-controller.js index ed358ff9b..1b1b33513 100644 --- a/ext/js/pages/settings/dictionary-import-controller.js +++ b/ext/js/pages/settings/dictionary-import-controller.js @@ -676,7 +676,8 @@ export class DictionaryImportController { if (profilesDictionarySettings === null || typeof profilesDictionarySettings[profileId] === 'undefined') { targets.push({action: 'push', path: path1, items: [defaultSettings]}); } else { - const {index, ...currentSettings} = profilesDictionarySettings[profileId]; + const {index, alias, name, ...currentSettings} = profilesDictionarySettings[profileId]; + const newAlias = alias === name ? title : alias; targets.push({ action: 'splice', path: path1, @@ -684,6 +685,7 @@ export class DictionaryImportController { items: [{ ...currentSettings, name: title, + alias: newAlias, }], deleteCount: 0, });