diff options
author | Ajay Ramachandran <[email protected]> | 2019-08-31 21:17:07 -0400 |
---|---|---|
committer | Ajay Ramachandran <[email protected]> | 2019-08-31 21:17:07 -0400 |
commit | 21ce614bd92231df1d1c2e0df907a79b8bb01981 (patch) | |
tree | 29ba260b428eb9a0d36bdfd5e34544488c9d9cfd | |
parent | 7f56ec238fcfac7c84ba373f2ea7e86f63658b6e (diff) | |
download | SponsorBlock-21ce614bd92231df1d1c2e0df907a79b8bb01981.tar.gz SponsorBlock-21ce614bd92231df1d1c2e0df907a79b8bb01981.zip |
Made the function clear whitelisted channels that were null.
-rw-r--r-- | content.js | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -500,6 +500,23 @@ function whitelistCheck() { UUIDs = []; channelWhitelisted = true; + + //make sure the whitelistedChannels array isn't broken and full of null entries + //TODO: remove this at some point in the future as the bug that caused this should be patched + if (whitelistedChannels.some((el) => el === null)) { + //remove the entries that are null + let cleanWhitelistedChannelsArray = []; + for (let i = 0; i < whitelistedChannels.length; i++) { + let channelURL = whitelistedChannels[i]; + if (channelURL !== null) { + //add it + cleanWhitelistedChannelsArray.push(channelURL); + } + } + + //save this value + chrome.storage.sync.set({"whitelistedChannels": cleanWhitelistedChannelsArray}); + } } }); } |