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" ],