summaryrefslogtreecommitdiff
path: root/frontend/src/store.tsx
diff options
context:
space:
mode:
authorTrainDoctor <traindoctor@protonmail.com>2022-11-06 15:37:02 -0800
committerTrainDoctor <traindoctor@protonmail.com>2022-11-06 15:37:02 -0800
commit898271b33d74761310a9a92a67c5929ce3264297 (patch)
tree01d60baec2ddc1631018778fe2126bb7959a08fc /frontend/src/store.tsx
parentb44896524f44fd862f9a385147cd755104a09cdc (diff)
downloaddecky-loader-898271b33d74761310a9a92a67c5929ce3264297.tar.gz
decky-loader-898271b33d74761310a9a92a67c5929ce3264297.zip
Revert "Disable store selection until PRs actually deploy to testing"
This reverts commit d389b403b521c48920d872c6ddd133b63ada2528.
Diffstat (limited to 'frontend/src/store.tsx')
-rw-r--r--frontend/src/store.tsx76
1 files changed, 35 insertions, 41 deletions
diff --git a/frontend/src/store.tsx b/frontend/src/store.tsx
index bc9f281c..11c805a0 100644
--- a/frontend/src/store.tsx
+++ b/frontend/src/store.tsx
@@ -26,47 +26,41 @@ export type PluginUpdateMapping = Map<string, StorePluginVersion>;
export async function getPluginList(): Promise<StorePlugin[]> {
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', Store.Default);
- // let customURL = await getSetting<string>('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', Store.Default);
+ let customURL = await getSetting<string>('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) {