mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-07-11 03:42:01 +00:00
5e3de747d3
* Add services and updated installer files * Loader updates service file during update! * Testing update branch doesn't exist lol * Update to dfl 3.7.12 * Fix services and add working service updater * Revert services but replace their aliases * Fix install scripts as well * Move leftover service files to .systemd dir * No wonder it's not trimming the file... * fix whitespace * Remove unused imports * Remove another un-used import Co-authored-by: AAGaming <aa@mail.catvibers.me>
42 lines
1.2 KiB
TypeScript
42 lines
1.2 KiB
TypeScript
import { Dropdown, Field } from 'decky-frontend-lib';
|
|
import { FunctionComponent } from 'react';
|
|
|
|
import Logger from '../../../../logger';
|
|
import { callUpdaterMethod } from '../../../../updater';
|
|
import { useSetting } from '../../../../utils/hooks/useSetting';
|
|
|
|
const logger = new Logger('BranchSelect');
|
|
|
|
enum UpdateBranch {
|
|
Stable,
|
|
Prerelease,
|
|
// Testing,
|
|
}
|
|
|
|
const BranchSelect: FunctionComponent<{}> = () => {
|
|
const [selectedBranch, setSelectedBranch] = useSetting<UpdateBranch>('branch', UpdateBranch.Prerelease);
|
|
|
|
return (
|
|
// Returns numerical values from 0 to 2 (with current branch setup as of 8/28/22)
|
|
// 0 being stable, 1 being pre-release and 2 being nightly
|
|
<Field label="Update Channel">
|
|
<Dropdown
|
|
rgOptions={Object.values(UpdateBranch)
|
|
.filter((branch) => typeof branch == 'string')
|
|
.map((branch) => ({
|
|
label: branch,
|
|
data: UpdateBranch[branch],
|
|
}))}
|
|
selectedOption={selectedBranch}
|
|
onChange={async (newVal) => {
|
|
await setSelectedBranch(newVal.data);
|
|
callUpdaterMethod('check_for_updates');
|
|
logger.log('switching branches!');
|
|
}}
|
|
/>
|
|
</Field>
|
|
);
|
|
};
|
|
|
|
export default BranchSelect;
|