Skip to content

Commit 12f0dbb

Browse files
committed
Prevent button "Confirm retrieval and deletion" from showing up when app is updating
1 parent 713c0f9 commit 12f0dbb

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/components/library/RetrieveDialog.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -249,20 +249,23 @@ export const RetrieveDialog = ({
249249
<OperationStatusGroup className="mt-2">
250250
<OperationStatus
251251
label={
252-
view === "app-version-check" ?
253-
needsRefresh ?
254-
"New version available, reloading"
255-
: "Checking for new app version"
252+
needsRefresh ? "New version available, updating"
253+
: view === "app-version-check" ?
254+
"Checking for new app version"
256255
: "Your app is up to date"
257256
}
258-
status={view === "app-version-check" ? "running" : "success"}
257+
status={
258+
view === "app-version-check" || needsRefresh ?
259+
"running"
260+
: "success"
261+
}
259262
/>
260263
</OperationStatusGroup>
261264

262265
<Button
263266
className="mt-2 sm:mx-auto sm:w-fit"
264267
variant="destructive"
265-
disabled={view !== "delete-confirmation"}
268+
disabled={view !== "delete-confirmation" || needsRefresh}
266269
onClick={retrieveData}
267270
>
268271
Confirm retrieval and deletion
@@ -310,7 +313,7 @@ export const RetrieveDialog = ({
310313
<Input
311314
className="mt-2"
312315
id="decryption-key"
313-
// eslint-disable-next-line jsx-a11y/no-autofocus -- usefull in this case
316+
// eslint-disable-next-line jsx-a11y/no-autofocus -- useful in this case
314317
autoFocus
315318
spellCheck={false}
316319
autoComplete="off"

0 commit comments

Comments
 (0)