Skip to content

Commit 7ca2e0a

Browse files
committed
tell user that install failed instead of relaunch
1 parent 35317c6 commit 7ca2e0a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

apps/desktop/src/components/main/body/update.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { type UnlistenFn } from "@tauri-apps/api/event";
2+
import { message } from "@tauri-apps/plugin-dialog";
23
import { relaunch } from "@tauri-apps/plugin-process";
34
import { useCallback, useEffect, useState } from "react";
45

@@ -13,8 +14,15 @@ export function Update() {
1314
if (!version) {
1415
return;
1516
}
16-
await commands.install(version);
17-
await relaunch();
17+
const result = await commands.install(version);
18+
if (result.status === "ok") {
19+
await relaunch();
20+
} else {
21+
await message(`Failed to install update: ${result.error}`, {
22+
title: "Update Failed",
23+
kind: "error",
24+
});
25+
}
1826
}, [version]);
1927

2028
if (!version) {

0 commit comments

Comments
 (0)