Skip to content

Commit 8c2258a

Browse files
committed
Add notice about hook category change
1 parent 44177b9 commit 8c2258a

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

public/_locales

src/components/SponsorTimeEditComponent.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { asyncRequestToServer } from "../utils/requests";
1111
import { defaultPreviewTime } from "../utils/constants";
1212
import { getVideo, getVideoDuration } from "../../maze-utils/src/video";
1313
import { AnimationUtils } from "../../maze-utils/src/animationUtils";
14+
import { Tooltip } from "../render/Tooltip";
1415

1516
export interface SponsorTimeEditProps {
1617
index: number;
@@ -494,6 +495,23 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
494495
return;
495496
}
496497

498+
// Hook update
499+
if (!Config.config.hookUpdate && chosenCategory === "preview") {
500+
Config.config.hookUpdate = true;
501+
502+
const target = event.target.closest(".sponsorSkipNotice tbody");
503+
if (target) {
504+
new Tooltip({
505+
text: chrome.i18n.getMessage("hookNewFeature"),
506+
referenceNode: target.parentElement,
507+
prependElement: target as HTMLElement,
508+
bottomOffset: "30px",
509+
opacity: 0.9,
510+
timeout: 100
511+
});
512+
}
513+
}
514+
497515
const sponsorTime = this.props.contentContainer().sponsorTimesSubmitting[this.props.index];
498516
this.handleReplacingLostTimes(chosenCategory, sponsorTime.actionType, sponsorTime);
499517
this.saveEditTimes();

src/config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ interface SBConfig {
6262
};
6363
scrollToEditTimeUpdate: boolean;
6464
categoryPillUpdate: boolean;
65+
hookUpdate: boolean;
6566
showChapterInfoMessage: boolean;
6667
darkMode: boolean;
6768
showCategoryGuidelines: boolean;
@@ -335,6 +336,7 @@ const syncDefaults = {
335336
skipNonMusicOnlyOnYoutubeMusic: false,
336337
scrollToEditTimeUpdate: false, // false means the tooltip will be shown
337338
categoryPillUpdate: false,
339+
hookUpdate: false,
338340
showChapterInfoMessage: true,
339341
darkMode: true,
340342
showCategoryGuidelines: true,

0 commit comments

Comments
 (0)