Disable store selection until PRs actually deploy to testing

This commit is contained in:
TrainDoctor
2022-10-30 10:38:49 -07:00
parent bace5143d2
commit d389b403b5
2 changed files with 43 additions and 37 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 -29
View File
@@ -27,41 +27,47 @@ 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();
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', { return fetch('https://plugins.deckbrew.xyz/plugins', {
method: 'GET', method: 'GET',
headers: { headers: {
'X-Decky-Version': version.current, 'X-Decky-Version': version.current,
}, },
}).then((r) => r.json()); }).then((r) => r.json());
} else { // let store = await getSetting<Store>('store', Store.Default);
switch (+store) { // let customURL = await getSetting<string>('store-url', 'https://plugins.deckbrew.xyz/plugins');
case Store.Default: // let storeURL;
storeURL = 'https://plugins.deckbrew.xyz/plugins'; // if (!store) {
break; // console.log('Could not get a default store, using Default.');
case Store.Testing: // await setSetting('store-url', Store.Default);
storeURL = 'https://testing.deckbrew.xyz/plugins'; // return fetch('https://plugins.deckbrew.xyz/plugins', {
break; // method: 'GET',
case Store.Custom: // headers: {
storeURL = customURL; // 'X-Decky-Version': version.current,
break; // },
default: // }).then((r) => r.json());
console.error('Somehow you ended up without a standard URL, using the default URL.'); // } else {
storeURL = 'https://plugins.deckbrew.xyz/plugins'; // switch (+store) {
break; // case Store.Default:
} // storeURL = 'https://plugins.deckbrew.xyz/plugins';
return fetch(storeURL, { // break;
method: 'GET', // case Store.Testing:
headers: { // storeURL = 'https://testing.deckbrew.xyz/plugins';
'X-Decky-Version': version.current, // break;
}, // case Store.Custom:
}).then((r) => r.json()); // 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) { export async function installFromURL(url: string) {