Fix export/import not appearing without segments and without chapter enabled

This commit is contained in:
Ajay
2022-09-01 16:32:23 -04:00
parent 69c0fe1caf
commit 9e08d6012c
3 changed files with 7 additions and 9 deletions

View File

@@ -248,7 +248,8 @@ function messageListener(request: Message, sender: unknown, sendResponse: (respo
for (const segment of importedSegments) {
if (!sponsorTimesSubmitting.concat(sponsorTimes ?? []).some(
(s) => Math.abs(s.segment[0] - segment.segment[0]) < 1
&& Math.abs(s.segment[1] - segment.segment[1]) < 1)) {
&& Math.abs(s.segment[1] - segment.segment[1]) < 1)
&& (segment.category !== "chapter" || utils.getCategorySelection("chapter"))) {
sponsorTimesSubmitting.push(segment);
addedSegments = true;
}