diff options
author | FlorianZahn <[email protected]> | 2021-10-14 08:05:55 +0200 |
---|---|---|
committer | FlorianZahn <[email protected]> | 2021-10-14 08:05:55 +0200 |
commit | a457a8009ec4f9f55199a3b6603cd8bd411a9ba3 (patch) | |
tree | bc326fcb5b40d946b0f4c9be8482dc919fc36565 | |
parent | 7698be8462c792881950358eed0697d8bb5c92f0 (diff) | |
download | SponsorBlock-a457a8009ec4f9f55199a3b6603cd8bd411a9ba3.tar.gz SponsorBlock-a457a8009ec4f9f55199a3b6603cd8bd411a9ba3.zip |
SkipNotice countdown now updates again on config update
-rw-r--r-- | src/components/SkipNoticeComponent.tsx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/components/SkipNoticeComponent.tsx b/src/components/SkipNoticeComponent.tsx index 4664ff76..b20776b7 100644 --- a/src/components/SkipNoticeComponent.tsx +++ b/src/components/SkipNoticeComponent.tsx @@ -631,6 +631,7 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta switch (type) { case 0: + this.clearConfigListener(); this.setNoticeInfoMessageWithOnClick(() => window.open(wikiLinkText), chrome.i18n.getMessage("OpenCategoryWikiPage")); this.setState({ voted: utils.replaceArrayElement(this.state.voted, SkipNoticeAction.Downvote, index) @@ -694,11 +695,18 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta } closeListener(): void { - //this.clearConfigListener(); + this.clearConfigListener(); this.props.closeListener(); } + clearConfigListener(): void { + if (this.configListener) { + Config.configListeners.splice(Config.configListeners.indexOf(this.configListener), 1); + this.configListener = null; + } + } + unmutedListener(): void { if (this.props.segments.length === 1 && this.props.segments[0].actionType === ActionType.Mute |