From 651ca5b4dce17a10fc807f849afaf119989d479e Mon Sep 17 00:00:00 2001 From: Shiba <44804845+DeepDoge@users.noreply.github.com> Date: Fri, 15 Apr 2022 10:30:49 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20debug=20code=20removed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/settings.ts | 5 ----- src/common/useSettings.ts | 16 +++++++--------- src/manifest.json | 1 - 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/src/common/settings.ts b/src/common/settings.ts index f1ba6e5..e19c13f 100644 --- a/src/common/settings.ts +++ b/src/common/settings.ts @@ -125,10 +125,5 @@ export const ytUrlResolversSettings = { name: "Madiator Finder", href: "https://finder.madiator.com/api/v1/resolve", signRequest: true - }), - local: ytUrlResolver({ - name: "Local", - href: "http://localhost:3000/api/v1/resolve", - signRequest: true }) } \ No newline at end of file diff --git a/src/common/useSettings.ts b/src/common/useSettings.ts index 2fc4ee3..62339b2 100644 --- a/src/common/useSettings.ts +++ b/src/common/useSettings.ts @@ -19,6 +19,12 @@ export function useSettings(initial: ExtensionSettings) { if (changeSet.length === 0) return // no changes; no use dispatching dispatch(Object.fromEntries(changeSet)) } + + if (!state.privateKey || !state.publicKey) generateKeys().then((keys) => { + setSetting('publicKey', keys.publicKey) + setSetting('privateKey', keys.privateKey) + }) + chrome.storage.onChanged.addListener(changeListener) chrome.storage.local.get(Object.keys(initial), o => dispatch(o as Partial)) @@ -33,12 +39,4 @@ export const setSetting = (setting: K, value: /** A hook to read watch on lbry settings from local storage */ -export const useLbrySettings = () => useSettings(DEFAULT_SETTINGS) - -{ - const settings = useLbrySettings() - if (!settings.publicKey || !settings.privateKey) generateKeys().then((keys) => { - setSetting('publicKey', keys.publicKey) - setSetting('privateKey', keys.privateKey) - }) -} \ No newline at end of file +export const useLbrySettings = () => useSettings(DEFAULT_SETTINGS) \ No newline at end of file diff --git a/src/manifest.json b/src/manifest.json index 34b2ec6..d150e80 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -12,7 +12,6 @@ "https://odysee.com/", "https://madiator.com/", "https://finder.madiator.com/", - "http://localhost:3000", "tabs", "storage" ],