🔥 debug code removed

This commit is contained in:
Shiba 2022-04-15 10:30:49 +00:00
parent 2a3771e45a
commit 651ca5b4dc
3 changed files with 7 additions and 15 deletions

View file

@ -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
})
}

View file

@ -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<ExtensionSettings>))
@ -33,12 +39,4 @@ export const setSetting = <K extends keyof ExtensionSettings>(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)
})
}
export const useLbrySettings = () => useSettings(DEFAULT_SETTINGS)

View file

@ -12,7 +12,6 @@
"https://odysee.com/",
"https://madiator.com/",
"https://finder.madiator.com/",
"http://localhost:3000",
"tabs",
"storage"
],