Fix invalid node/selectors being used in the dictionary delete process (#1658)

This commit is contained in:
toasted-nutbread 2021-05-10 18:04:08 -04:00 committed by GitHub
parent 210f633dcc
commit 376a28326b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -624,16 +624,9 @@ class DictionaryController {
if (index < 0) { return; } if (index < 0) { return; }
const statusFooter = this._statusFooter; const statusFooter = this._statusFooter;
const {node} = this._dictionaryEntries[index];
const progressSelector = '.dictionary-delete-progress'; const progressSelector = '.dictionary-delete-progress';
const progressContainers = [ const progressContainers = document.querySelectorAll(`#dictionaries-modal ${progressSelector}`);
...node.querySelectorAll('.progress-container'), const progressBars = document.querySelectorAll(`${progressSelector} .progress-bar`);
...document.querySelectorAll(`#dictionaries-modal ${progressSelector}`)
];
const progressBars = [
...node.querySelectorAll('.progress-bar'),
...document.querySelectorAll(`${progressSelector} .progress-bar`)
];
const infoLabels = document.querySelectorAll(`${progressSelector} .progress-info`); const infoLabels = document.querySelectorAll(`${progressSelector} .progress-info`);
const statusLabels = document.querySelectorAll(`${progressSelector} .progress-status`); const statusLabels = document.querySelectorAll(`${progressSelector} .progress-status`);
const prevention = this._settingsController.preventPageExit(); const prevention = this._settingsController.preventPageExit();