From 68b884410cb56cda9e9e3f4026fb2960286a1ab7 Mon Sep 17 00:00:00 2001 From: Nikkel Mollenhauer <57323886+NikkelM@users.noreply.github.com> Date: Fri, 24 Feb 2023 06:51:52 +0100 Subject: [PATCH] Hotfixed API error (#92) --- CHANGELOG.md | 8 ++++++-- extension/js/background.js | 7 +++++++ extension/manifest.json | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 804e10cc..42ac76b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,15 @@ # Changelog -## v1.2.0 +## v1.2.1 -- You are now able to set the percentage of videos that are shuffled for each individual channel instead of one global value. Simply visit a channel or video page and open the extension popup. +- Fixed an issue with the API +## v1.2.0 + +- You are now able to set the percentage of videos that are shuffled for each individual channel instead of one global value. Simply visit a channel or video page and open the extension popup. + ## v1.1.2 - Removed unnecessary logging. diff --git a/extension/js/background.js b/extension/js/background.js index d9bf3f99..e9a4bf92 100644 --- a/extension/js/background.js +++ b/extension/js/background.js @@ -57,6 +57,13 @@ async function handleExtensionFirstInstall(manifestData) { async function handleExtensionUpdate(manifestData) { console.log(`Extension was updated to version v${manifestData.version}`); + // Only for the 1.2.1 update + // Delete the youtubeAPIKey from local storage if it exists + const localStorageContents = await chrome.storage.local.get(); + if (localStorageContents["youtubeAPIKey"]) { + await chrome.storage.local.remove("youtubeAPIKey"); + } + // This variable indicates if the local storage should be cleared when updating to the newest version // Should only be true if changes were made to the data structure, requiring users to get the new data format from the database // Provide reason for clearing if applicable diff --git a/extension/manifest.json b/extension/manifest.json index 890ed4eb..7d2d00c6 100644 --- a/extension/manifest.json +++ b/extension/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 3, "name": "Random YouTube Video", "description": "Play a random video uploaded on the current YouTube channel.", - "version": "1.2.0", + "version": "1.2.1", "icons": { "16": "images/icon-16-red.png", "32": "images/icon-32-red.png",