Skip to content

Commit

Permalink
Update dictionary will update alias if alias is the same as previous …
Browse files Browse the repository at this point in the history
…title (#1568)

Update dictionary alias if it is the same as title
  • Loading branch information
khaitruong922 authored Nov 5, 2024
1 parent 37513b1 commit dc174a9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ext/js/pages/settings/dictionary-import-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -676,14 +676,16 @@ 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,
start: index,
items: [{
...currentSettings,
name: title,
alias: newAlias,
}],
deleteCount: 0,
});
Expand Down

0 comments on commit dc174a9

Please sign in to comment.