Skip to content

Commit

Permalink
Make patch notes modal only show current branch (#429)
Browse files Browse the repository at this point in the history
  • Loading branch information
beebls authored Apr 24, 2023
1 parent fc193f9 commit 4777963
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions backend/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ async def check_for_updates(self):
async with ClientSession() as web:
async with web.request("GET", "https://api.github.com/repos/SteamDeckHomebrew/decky-loader/releases", ssl=helpers.get_ssl_context()) as res:
remoteVersions = await res.json()
if selectedBranch == 0:
logger.debug("release type: release")
remoteVersions = list(filter(lambda ver: ver["tag_name"].startswith("v") and not ver["prerelease"] and not ver["tag_name"].find("-pre") > 0 and ver["tag_name"], remoteVersions))
elif selectedBranch == 1:
logger.debug("release type: pre-release")
remoteVersions = list(filter(lambda ver:ver["tag_name"].startswith("v"), remoteVersions))
else:
logger.error("release type: NOT FOUND")
raise ValueError("no valid branch found")
self.allRemoteVers = remoteVersions
logger.debug("determining release type to find, branch is %i" % selectedBranch)
if selectedBranch == 0:
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/settings/pages/general/Updater.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function PatchNotesModal({ versionInfo, closeModal }: { versionInfo: VerInfo | n
}}
>
<div>
<h1>{versionInfo?.all?.[id]?.name}</h1>
<h1>{versionInfo?.all?.[id]?.name || 'Invalid Update Name'}</h1>
{versionInfo?.all?.[id]?.body ? (
<WithSuspense>
<MarkdownRenderer onDismiss={closeModal}>{versionInfo.all[id].body}</MarkdownRenderer>
Expand Down

0 comments on commit 4777963

Please sign in to comment.