From 1ffe42771f7edf241266766baec8811d2458708d Mon Sep 17 00:00:00 2001 From: Ajay Date: Sun, 26 Feb 2023 20:15:33 -0500 Subject: [PATCH] Fix unhiding one segment unhiding all --- src/utils.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/utils.ts b/src/utils.ts index cb5e9a34..0afc1a6a 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -349,7 +349,11 @@ export default class Utils { currentVideoData.lastAccess = Date.now(); const existingData = currentVideoData.segments.find((segment) => segment.uuid === UUIDHash); if (hidden === SponsorHideType.Visible) { - delete allDownvotes[hashedVideoID]; + currentVideoData.segments.splice(currentVideoData.segments.indexOf(existingData), 1); + + if (currentVideoData.segments.length === 0) { + delete allDownvotes[hashedVideoID]; + } } else { if (existingData) { existingData.hidden = hidden;