Skip to content

Commit

Permalink
Fix dictionary move to index (#514)
Browse files Browse the repository at this point in the history
* Fix dictionary move to index

* Use number isnan
  • Loading branch information
jbukl authored Jan 13, 2024
1 parent 36c40ff commit 2aea929
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ext/js/pages/settings/dictionary-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -716,9 +716,9 @@ export class DictionaryController {
/** */
_onDictionaryMoveButtonClick() {
const modal = /** @type {import('./modal.js').Modal} */ (this._modalController.getModal('dictionary-move-location'));
const {index} = modal.node.dataset;
if (typeof index !== 'number') { return; }
const index = modal.node.dataset.index ?? '';
const indexNumber = Number.parseInt(index, 10);
if (Number.isNaN(indexNumber)) { return; }

/** @type {HTMLInputElement} */
const targetStringInput = querySelectorNotNull(document, '#dictionary-move-location');
Expand Down

0 comments on commit 2aea929

Please sign in to comment.