diff --git a/backend/src/updater.py b/backend/src/updater.py index 4939fef1d..f646e5936 100644 --- a/backend/src/updater.py +++ b/backend/src/updater.py @@ -285,7 +285,6 @@ async def get_testing_versions(self) -> List[TestingVersion]: return result async def download_testing_version(self, pr_id: int, sha_id: str): - #manager.setSetting('branch', 2) #TODO: actually change the branch. maybe don't do it here? down_id = '' #Get all the associated workflow run for the given sha_id code hash async with ClientSession() as web: @@ -311,5 +310,3 @@ async def download_testing_version(self, pr_id: int, sha_id: str): down_link = f"https://nightly.link/SteamDeckHomebrew/decky-loader/actions/artifacts/{jresp['artifacts'][0]['id']}.zip" #Then fetch it and restart itself await self.download_decky_binary(down_link, f'PR-{pr_id}' , True) - #TODO: If I ended here either the API is rate limiting or there is no artifact for that specific head_sha yet, show an UI warning here. - logger.debug("TODO: Show warning to the user!") diff --git a/frontend/src/components/settings/pages/general/BranchSelect.tsx b/frontend/src/components/settings/pages/general/BranchSelect.tsx index 506fd0b2c..e6b46eae0 100644 --- a/frontend/src/components/settings/pages/general/BranchSelect.tsx +++ b/frontend/src/components/settings/pages/general/BranchSelect.tsx @@ -8,7 +8,7 @@ import { useSetting } from '../../../../utils/hooks/useSetting'; const logger = new Logger('BranchSelect'); -enum UpdateBranch { +export enum UpdateBranch { Stable, Prerelease, Testing, diff --git a/frontend/src/components/settings/pages/testing/index.tsx b/frontend/src/components/settings/pages/testing/index.tsx index 68f429e56..a32ce80e5 100644 --- a/frontend/src/components/settings/pages/testing/index.tsx +++ b/frontend/src/components/settings/pages/testing/index.tsx @@ -4,6 +4,8 @@ import { useTranslation } from 'react-i18next'; import { FaDownload, FaInfo } from 'react-icons/fa'; import { callUpdaterMethod } from '../../../../updater'; +import { setSetting } from '../../../../utils/settings'; +import { UpdateBranch } from '../general/BranchSelect'; interface TestingVersion { id: number; @@ -43,9 +45,10 @@ export default function TestingVersionList() { - callUpdaterMethod('download_testing_version', { pr_id: version.id, sha_id: version.head_sha }) - } + onClick={() => { + callUpdaterMethod('download_testing_version', { pr_id: version.id, sha_id: version.head_sha }); + setSetting('branch', UpdateBranch.Testing); + }} >