summaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
authorTrainDoctor <traindoctor@protonmail.com>2022-08-23 15:23:23 -0700
committerTrainDoctor <traindoctor@protonmail.com>2022-08-23 15:23:23 -0700
commitde1c89af21dff08cf75135228e745bd2e4b1df6d (patch)
tree89f29139de7cf66dcee5b88060f31f75578cb2cc /frontend
parent8b3f569a09db9daf7748426f916a66591159928f (diff)
downloaddecky-loader-de1c89af21dff08cf75135228e745bd2e4b1df6d.tar.gz
decky-loader-de1c89af21dff08cf75135228e745bd2e4b1df6d.zip
Fix updater being corrupted by multiple attempts to download
Diffstat (limited to 'frontend')
-rw-r--r--frontend/package.json2
-rw-r--r--frontend/pnpm-lock.yaml12
-rw-r--r--frontend/src/components/DeckyState.tsx8
-rw-r--r--frontend/src/components/settings/pages/general/Updater.tsx6
4 files changed, 22 insertions, 6 deletions
diff --git a/frontend/package.json b/frontend/package.json
index 439de55b..d5224648 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -37,7 +37,7 @@
}
},
"dependencies": {
- "decky-frontend-lib": "^1.7.5",
+ "decky-frontend-lib": "^1.7.8",
"react-icons": "^4.4.0"
}
}
diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml
index 1a449431..9008383d 100644
--- a/frontend/pnpm-lock.yaml
+++ b/frontend/pnpm-lock.yaml
@@ -9,7 +9,7 @@ specifiers:
'@types/react': 16.14.0
'@types/react-router': 5.1.18
'@types/webpack': ^5.28.0
- decky-frontend-lib: ^1.7.5
+ decky-frontend-lib: ^1.7.8
husky: ^8.0.1
import-sort-style-module: ^6.0.0
inquirer: ^8.2.4
@@ -23,7 +23,7 @@ specifiers:
typescript: ^4.7.4
dependencies:
- decky-frontend-lib: 1.7.5
+ decky-frontend-lib: 1.7.8
react-icons: 4.4.0_react@16.14.0
devDependencies:
@@ -806,8 +806,8 @@ packages:
ms: 2.1.2
dev: true
- /decky-frontend-lib/1.7.5:
- resolution: {integrity: sha512-1OX/Ix9W76gF0NJjfm0k/01LYPmC2k/k+k/qqH8JJPlPHh5+W5P8ZG2T8m5wKsqoP7jx2W3k7RNZBh9vAqFoFw==}
+ /decky-frontend-lib/1.7.8:
+ resolution: {integrity: sha512-CO6EJDxw/Eb6Ovng29IhZxC7SrlGT/iWMgFtKp7x3e7SVfwk9VHygyYBeVHaicj4n4LMgNE8iehh5k22Keyvbw==}
dependencies:
minimist: 1.2.6
dev: false
@@ -1255,6 +1255,10 @@ packages:
brace-expansion: 1.1.11
dev: true
+ /minimist/1.2.6:
+ resolution: {integrity: sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==}
+ dev: false
+
/ms/2.1.2:
resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==}
dev: true
diff --git a/frontend/src/components/DeckyState.tsx b/frontend/src/components/DeckyState.tsx
index 6f13a007..739da0e1 100644
--- a/frontend/src/components/DeckyState.tsx
+++ b/frontend/src/components/DeckyState.tsx
@@ -8,6 +8,7 @@ interface PublicDeckyState {
activePlugin: Plugin | null;
updates: PluginUpdateMapping | null;
hasLoaderUpdate?: boolean;
+ isLoaderUpdating: boolean;
}
export class DeckyState {
@@ -15,6 +16,7 @@ export class DeckyState {
private _activePlugin: Plugin | null = null;
private _updates: PluginUpdateMapping | null = null;
private _hasLoaderUpdate: boolean = false;
+ private _isLoaderUpdating: boolean = false;
public eventBus = new EventTarget();
@@ -24,6 +26,7 @@ export class DeckyState {
activePlugin: this._activePlugin,
updates: this._updates,
hasLoaderUpdate: this._hasLoaderUpdate,
+ isLoaderUpdating: this._isLoaderUpdating,
};
}
@@ -52,6 +55,11 @@ export class DeckyState {
this.notifyUpdate();
}
+ setIsLoaderUpdating(isUpdating: boolean) {
+ this._isLoaderUpdating = isUpdating;
+ this.notifyUpdate();
+ }
+
private notifyUpdate() {
this.eventBus.dispatchEvent(new Event('update'));
}
diff --git a/frontend/src/components/settings/pages/general/Updater.tsx b/frontend/src/components/settings/pages/general/Updater.tsx
index 3d137d7a..4906c435 100644
--- a/frontend/src/components/settings/pages/general/Updater.tsx
+++ b/frontend/src/components/settings/pages/general/Updater.tsx
@@ -9,6 +9,8 @@ export default function UpdaterSettings() {
const [updateProgress, setUpdateProgress] = useState<number>(-1);
const [reloading, setReloading] = useState<boolean>(false);
const [checkingForUpdates, setCheckingForUpdates] = useState<boolean>(false);
+ const [loaderUpdating, setLoaderUpdating] = useState<boolean>(false);
+
useEffect(() => {
(async () => {
const res = (await callUpdaterMethod('get_version')) as { result: VerInfo };
@@ -36,7 +38,7 @@ export default function UpdaterSettings() {
>
{updateProgress == -1 ? (
<DialogButton
- disabled={!versionInfo?.updatable || checkingForUpdates}
+ disabled={!versionInfo?.updatable || checkingForUpdates || loaderUpdating}
onClick={
!versionInfo?.remote || versionInfo?.remote?.tag_name == versionInfo?.current
? async () => {
@@ -49,10 +51,12 @@ export default function UpdaterSettings() {
window.DeckyUpdater = {
updateProgress: (i) => {
setUpdateProgress(i);
+ setLoaderUpdating(true);
},
finish: async () => {
setUpdateProgress(0);
setReloading(true);
+ setLoaderUpdating(false);
await finishUpdate();
},
};