mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-10 05:27:03 +03:00
Moved notice closing to renderer (no leftover nodes)
This commit is contained in:
@@ -11,7 +11,7 @@ export interface NoticeProps {
|
||||
fadeIn?: boolean,
|
||||
|
||||
// Callback for when this is closed
|
||||
closeListener?: () => void,
|
||||
closeListener: () => void,
|
||||
|
||||
zIndex?: number
|
||||
}
|
||||
@@ -195,16 +195,10 @@ class NoticeComponent extends React.Component<NoticeProps, NoticeState> {
|
||||
* @param silent If true, the close listener will not be called
|
||||
*/
|
||||
close(silent?: boolean) {
|
||||
//TODO: Change to a listener in the renderer (not component)
|
||||
let notice = document.getElementById("sponsorSkipNotice" + this.idSuffix);
|
||||
if (notice != null) {
|
||||
notice.remove();
|
||||
}
|
||||
|
||||
//remove setInterval
|
||||
if (this.countdownInterval !== null) clearInterval(this.countdownInterval);
|
||||
|
||||
if (this.props.closeListener && !silent) this.props.closeListener();
|
||||
if (!silent) this.props.closeListener();
|
||||
}
|
||||
|
||||
changeNoticeTitle(title) {
|
||||
|
||||
Reference in New Issue
Block a user