Allow importing segments with no category

Also fixes case when importing chapters when having no permission to submit chapters
This commit is contained in:
Ajay
2024-04-26 16:44:20 -04:00
parent e1d656f43f
commit 56bb22d03d
2 changed files with 17 additions and 16 deletions

View File

@@ -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 = "";