Skip to content

Commit

Permalink
Remove import/export click listeners on unload (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante authored Aug 19, 2024
1 parent b08a896 commit 48d8a92
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ class OptionsSync<UserOptions extends Options> {
if (this._form) {
this._form.removeEventListener('input', this._handleFormInput);
this._form.removeEventListener('submit', this._handleFormSubmit);
this._form.querySelector('.js-export')?.addEventListener('click', this.exportToFile);
this._form.querySelector('.js-import')?.addEventListener('click', this.importFromFile);
this._form.querySelector('.js-export')?.removeEventListener('click', this.exportToFile);
this._form.querySelector('.js-import')?.removeEventListener('click', this.importFromFile);
chrome.storage.onChanged.removeListener(this._handleStorageChangeOnForm);
delete this._form;
}
Expand Down

0 comments on commit 48d8a92

Please sign in to comment.