From 87ef5971169dea132c561868995602dab0ff8436 Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 26 Aug 2023 20:05:29 +0700 Subject: [PATCH] fix empty cache at first start --- extension/background.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extension/background.js b/extension/background.js index 2e69992..57b86ed 100644 --- a/extension/background.js +++ b/extension/background.js @@ -143,7 +143,8 @@ async function videoExists(id) { async function getChannelCache() { let cache = await browserType.storage.local.get('cache'); - return cache || { cache: {} }; + if (cache.cache) return cache; + return { cache: {} }; } async function setChannel(channelHandler, channelId) {