Skip to content

Commit

Permalink
handle for loading during OTA Update
Browse files Browse the repository at this point in the history
  • Loading branch information
aarron-lee committed Dec 2, 2024
1 parent 8743243 commit acac3ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ async def ota_update(self):
# trigger ota update
try:
with file_timeout.time_limit(15):
plugin_update.ota_update()
return plugin_update.ota_update()
except Exception as e:
decky_plugin.logger.error(e)

Expand Down
10 changes: 7 additions & 3 deletions src/components/molecules/OtaUpdates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import {

const OtaUpdates = () => {
const [latestVersionNum, setLatestVersionNum] = useState("");
const [updateInProgress, setUpdateInProgress] = useState(false);

const installedVersionNum = useSelector(getInstalledVersionNumSelector);
const scalingDriver = useSelector(selectScalingDriver);

Expand Down Expand Up @@ -65,8 +67,10 @@ const OtaUpdates = () => {
</DeckyRow>
<DeckyRow>
<DeckyButton
onClick={() => {
otaUpdate();
onClick={async () => {
setUpdateInProgress(true);
await otaUpdate();
setUpdateInProgress(false);
}}
style={{
width: "100%",
Expand All @@ -76,7 +80,7 @@ const OtaUpdates = () => {
}}
layout={"below"}
>
{buttonText}
{updateInProgress ? "Updating..." : buttonText}
</DeckyButton>
</DeckyRow>
</>
Expand Down

0 comments on commit acac3ed

Please sign in to comment.