Fix submission menu after video ends and unskip button after video ends

This commit is contained in:
Ajay
2024-06-22 17:06:29 +05:30
parent d86dd37ec0
commit f177b95a5a
7 changed files with 14 additions and 12 deletions

View File

@@ -15,6 +15,7 @@ import { downvoteButtonColor, SkipNoticeAction } from "../utils/noticeUtils";
import { generateUserID } from "../../maze-utils/src/setup";
import { keybindToString } from "../../maze-utils/src/config";
import { getFormattedTime } from "../../maze-utils/src/formating";
import { getVideo } from "../../maze-utils/src/video";
enum SkipButtonState {
Undo, // Unskip
@@ -685,7 +686,7 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
getFullDurationCountdown(index: number): () => number {
return () => {
const sponsorTime = this.segments[index];
const duration = Math.round((sponsorTime.segment[1] - this.contentContainer().v.currentTime) * (1 / this.contentContainer().v.playbackRate));
const duration = Math.round((sponsorTime.segment[1] - getVideo().currentTime) * (1 / getVideo().playbackRate));
return Math.max(duration, Config.config.skipNoticeDuration);
};