From 898271b33d74761310a9a92a67c5929ce3264297 Mon Sep 17 00:00:00 2001 From: TrainDoctor Date: Sun, 6 Nov 2022 15:37:02 -0800 Subject: Revert "Disable store selection until PRs actually deploy to testing" This reverts commit d389b403b521c48920d872c6ddd133b63ada2528. --- .../components/settings/pages/general/index.tsx | 4 +- frontend/src/store.tsx | 76 ++++++++++------------ 2 files changed, 37 insertions(+), 43 deletions(-) (limited to 'frontend/src') diff --git a/frontend/src/components/settings/pages/general/index.tsx b/frontend/src/components/settings/pages/general/index.tsx index 0ebfee12..d661b779 100644 --- a/frontend/src/components/settings/pages/general/index.tsx +++ b/frontend/src/components/settings/pages/general/index.tsx @@ -5,7 +5,7 @@ import { FaShapes, FaTools } from 'react-icons/fa'; import { installFromURL } from '../../../../store'; import BranchSelect from './BranchSelect'; import RemoteDebuggingSettings from './RemoteDebugging'; -// import StoreSelect from './StoreSelect'; +import StoreSelect from './StoreSelect'; import UpdaterSettings from './Updater'; export default function GeneralSettings({ @@ -21,7 +21,7 @@ export default function GeneralSettings({
- {/* */} + ; export async function getPluginList(): Promise { let version = await window.DeckyPluginLoader.updateVersion(); - return fetch('https://plugins.deckbrew.xyz/plugins', { - method: 'GET', - headers: { - 'X-Decky-Version': version.current, - }, - }).then((r) => r.json()); - // let store = await getSetting('store', Store.Default); - // let customURL = await getSetting('store-url', 'https://plugins.deckbrew.xyz/plugins'); - // let storeURL; - // if (!store) { - // console.log('Could not get a default store, using Default.'); - // await setSetting('store-url', Store.Default); - // return fetch('https://plugins.deckbrew.xyz/plugins', { - // method: 'GET', - // headers: { - // 'X-Decky-Version': version.current, - // }, - // }).then((r) => r.json()); - // } else { - // switch (+store) { - // case Store.Default: - // storeURL = 'https://plugins.deckbrew.xyz/plugins'; - // break; - // case Store.Testing: - // storeURL = 'https://testing.deckbrew.xyz/plugins'; - // break; - // case Store.Custom: - // storeURL = customURL; - // break; - // default: - // console.error('Somehow you ended up without a standard URL, using the default URL.'); - // storeURL = 'https://plugins.deckbrew.xyz/plugins'; - // break; - // } - // return fetch(storeURL, { - // method: 'GET', - // headers: { - // 'X-Decky-Version': version.current, - // }, - // }).then((r) => r.json()); - // } + let store = await getSetting('store', Store.Default); + let customURL = await getSetting('store-url', 'https://plugins.deckbrew.xyz/plugins'); + let storeURL; + if (!store) { + console.log('Could not get a default store, using Default.'); + await setSetting('store-url', Store.Default); + return fetch('https://plugins.deckbrew.xyz/plugins', { + method: 'GET', + headers: { + 'X-Decky-Version': version.current, + }, + }).then((r) => r.json()); + } else { + switch (+store) { + case Store.Default: + storeURL = 'https://plugins.deckbrew.xyz/plugins'; + break; + case Store.Testing: + storeURL = 'https://testing.deckbrew.xyz/plugins'; + break; + case Store.Custom: + storeURL = customURL; + break; + default: + console.error('Somehow you ended up without a standard URL, using the default URL.'); + storeURL = 'https://plugins.deckbrew.xyz/plugins'; + break; + } + return fetch(storeURL, { + method: 'GET', + headers: { + 'X-Decky-Version': version.current, + }, + }).then((r) => r.json()); + } } export async function installFromURL(url: string) { -- cgit v1.2.3