mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-12 14:37:23 +03:00
Allow importing segments with no category
Also fixes case when importing chapters when having no permission to submit chapters
This commit is contained in:
@@ -303,7 +303,9 @@ function messageListener(request: Message, sender: unknown, sendResponse: (respo
|
||||
if (!sponsorTimesSubmitting.some(
|
||||
(s) => Math.abs(s.segment[0] - segment.segment[0]) < 1
|
||||
&& Math.abs(s.segment[1] - segment.segment[1]) < 1)) {
|
||||
if (segment.category === "chapter" && !utils.getCategorySelection("chapter")) {
|
||||
const hasChaptersPermission = (Config.config.showCategoryWithoutPermission
|
||||
|| Config.config.permissions["chapter"]);
|
||||
if (segment.category === "chapter" && (!utils.getCategorySelection("chapter") || !hasChaptersPermission)) {
|
||||
segment.category = "chooseACategory" as Category;
|
||||
segment.actionType = ActionType.Skip;
|
||||
segment.description = "";
|
||||
|
||||
Reference in New Issue
Block a user