mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-07 12:07:11 +03:00
Don't show harmful vote option for non chapters
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import Config from "../config";
|
import Config from "../config";
|
||||||
import { Category, SegmentUUID, SponsorTime } from "../types";
|
import { ActionType, Category, SegmentUUID, SponsorTime } from "../types";
|
||||||
|
|
||||||
import ThumbsUpSvg from "../svg-icons/thumbs_up_svg";
|
import ThumbsUpSvg from "../svg-icons/thumbs_up_svg";
|
||||||
import ThumbsDownSvg from "../svg-icons/thumbs_down_svg";
|
import ThumbsDownSvg from "../svg-icons/thumbs_down_svg";
|
||||||
@@ -65,6 +65,7 @@ class ChapterVoteComponent extends React.Component<ChapterVoteProps, ChapterVote
|
|||||||
this.tooltip.close();
|
this.tooltip.close();
|
||||||
this.tooltip = null;
|
this.tooltip = null;
|
||||||
} else {
|
} else {
|
||||||
|
if (this.state.segment?.actionType === ActionType.Chapter) {
|
||||||
const referenceNode = chapterNode?.parentElement?.parentElement;
|
const referenceNode = chapterNode?.parentElement?.parentElement;
|
||||||
if (referenceNode) {
|
if (referenceNode) {
|
||||||
const outerBounding = referenceNode.getBoundingClientRect();
|
const outerBounding = referenceNode.getBoundingClientRect();
|
||||||
@@ -95,6 +96,9 @@ class ChapterVoteComponent extends React.Component<ChapterVoteProps, ChapterVote
|
|||||||
]
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
this.vote(e, 0, e.target as HTMLElement)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}}>
|
}}>
|
||||||
<ThumbsDownSvg
|
<ThumbsDownSvg
|
||||||
|
|||||||
Reference in New Issue
Block a user