Revert "Disable store selection until PRs actually deploy to testing"

This reverts commit d389b403b5.
This commit is contained in:
TrainDoctor
2022-11-06 15:37:02 -08:00
parent b44896524f
commit 898271b33d
2 changed files with 37 additions and 43 deletions
@@ -5,7 +5,7 @@ import { FaShapes, FaTools } from 'react-icons/fa';
import { installFromURL } from '../../../../store'; import { installFromURL } from '../../../../store';
import BranchSelect from './BranchSelect'; import BranchSelect from './BranchSelect';
import RemoteDebuggingSettings from './RemoteDebugging'; import RemoteDebuggingSettings from './RemoteDebugging';
// import StoreSelect from './StoreSelect'; import StoreSelect from './StoreSelect';
import UpdaterSettings from './Updater'; import UpdaterSettings from './Updater';
export default function GeneralSettings({ export default function GeneralSettings({
@@ -21,7 +21,7 @@ export default function GeneralSettings({
<div> <div>
<UpdaterSettings /> <UpdaterSettings />
<BranchSelect /> <BranchSelect />
{/* <StoreSelect /> */} <StoreSelect />
<RemoteDebuggingSettings /> <RemoteDebuggingSettings />
<Field <Field
label="Developer mode" label="Developer mode"
+35 -41
View File
@@ -26,47 +26,41 @@ export type PluginUpdateMapping = Map<string, StorePluginVersion>;
export async function getPluginList(): Promise<StorePlugin[]> { export async function getPluginList(): Promise<StorePlugin[]> {
let version = await window.DeckyPluginLoader.updateVersion(); let version = await window.DeckyPluginLoader.updateVersion();
return fetch('https://plugins.deckbrew.xyz/plugins', { let store = await getSetting<Store>('store', Store.Default);
method: 'GET', let customURL = await getSetting<string>('store-url', 'https://plugins.deckbrew.xyz/plugins');
headers: { let storeURL;
'X-Decky-Version': version.current, if (!store) {
}, console.log('Could not get a default store, using Default.');
}).then((r) => r.json()); await setSetting('store-url', Store.Default);
// let store = await getSetting<Store>('store', Store.Default); return fetch('https://plugins.deckbrew.xyz/plugins', {
// let customURL = await getSetting<string>('store-url', 'https://plugins.deckbrew.xyz/plugins'); method: 'GET',
// let storeURL; headers: {
// if (!store) { 'X-Decky-Version': version.current,
// console.log('Could not get a default store, using Default.'); },
// await setSetting('store-url', Store.Default); }).then((r) => r.json());
// return fetch('https://plugins.deckbrew.xyz/plugins', { } else {
// method: 'GET', switch (+store) {
// headers: { case Store.Default:
// 'X-Decky-Version': version.current, storeURL = 'https://plugins.deckbrew.xyz/plugins';
// }, break;
// }).then((r) => r.json()); case Store.Testing:
// } else { storeURL = 'https://testing.deckbrew.xyz/plugins';
// switch (+store) { break;
// case Store.Default: case Store.Custom:
// storeURL = 'https://plugins.deckbrew.xyz/plugins'; storeURL = customURL;
// break; break;
// case Store.Testing: default:
// storeURL = 'https://testing.deckbrew.xyz/plugins'; console.error('Somehow you ended up without a standard URL, using the default URL.');
// break; storeURL = 'https://plugins.deckbrew.xyz/plugins';
// case Store.Custom: break;
// storeURL = customURL; }
// break; return fetch(storeURL, {
// default: method: 'GET',
// console.error('Somehow you ended up without a standard URL, using the default URL.'); headers: {
// storeURL = 'https://plugins.deckbrew.xyz/plugins'; 'X-Decky-Version': version.current,
// break; },
// } }).then((r) => r.json());
// return fetch(storeURL, { }
// method: 'GET',
// headers: {
// 'X-Decky-Version': version.current,
// },
// }).then((r) => r.json());
// }
} }
export async function installFromURL(url: string) { export async function installFromURL(url: string) {