Skip to content

Commit

Permalink
set branch to testing when user downloads a testing version
Browse files Browse the repository at this point in the history
  • Loading branch information
PartyWumpus committed Feb 9, 2024
1 parent 4e5907c commit 8a0c9c2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
3 changes: 0 additions & 3 deletions backend/src/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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!")
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useSetting } from '../../../../utils/hooks/useSetting';

const logger = new Logger('BranchSelect');

enum UpdateBranch {
export enum UpdateBranch {
Stable,
Prerelease,
Testing,
Expand Down
9 changes: 6 additions & 3 deletions frontend/src/components/settings/pages/testing/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -43,9 +45,10 @@ export default function TestingVersionList() {
<Focusable style={{ height: '40px', marginLeft: 'auto', display: 'flex' }}>
<DialogButton
style={{ height: '40px', minWidth: '60px', marginRight: '10px' }}
onClick={() =>
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);
}}
>
<div
style={{
Expand Down

0 comments on commit 8a0c9c2

Please sign in to comment.