Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix(desktop): offer download link when update check fails

Richie McIlroy0c2b499fe5c0
diff --git a/apps/desktop/src/routes/(window-chrome)/new-main/index.tsx b/apps/desktop/src/routes/(window-chrome)/new-main/index.tsx
index 52aba5175..d2ab89d6a 100644
--- a/apps/desktop/src/routes/(window-chrome)/new-main/index.tsx
+++ b/apps/desktop/src/routes/(window-chrome)/new-main/index.tsx
@@ -1567,10 +1567,13 @@ function createUpdateCheck() {
if (result) update = result;
} catch (e) {
console.error("Failed to check for updates:", e);
- await dialog.message(
- "Unable to check for updates. Please download the latest version manually from cap.so/download. Your data will not be lost.\n\nIf this issue persists, please contact support.",
- { title: "Update Error", kind: "error" },
- );
+ const openDownload = await dialog
+ .confirm(
+ "Couldn't check for updates automatically. You can download the latest version of Cap from cap.so/download \u2014 your data won't be lost.",
+ { title: "Update Cap", okLabel: "Download", cancelLabel: "Later" },
+ )
+ .catch(() => false);
+ if (openDownload) await shell.open("https://cap.so/download");
return;
}
diff --git a/apps/desktop/src/routes/(window-chrome)/settings.tsx b/apps/desktop/src/routes/(window-chrome)/settings.tsx
index 108167ad6..f20539ed7 100644
--- a/apps/desktop/src/routes/(window-chrome)/settings.tsx
+++ b/apps/desktop/src/routes/(window-chrome)/settings.tsx
@@ -431,10 +431,13 @@ export default function Settings(props: RouteSectionProps) {
if (shouldUpdate) navigate("/update");
} catch (e) {
console.error("Failed to check for updates:", e);
- await dialog.message(
- "Unable to check for updates. Please download the latest version manually from cap.so/download. Your data will not be lost.\n\nIf this issue persists, please contact support.",
- { title: "Update Error", kind: "error" },
- );
+ const openDownload = await dialog
+ .confirm(
+ "Couldn't check for updates automatically. You can download the latest version of Cap from cap.so/download \u2014 your data won't be lost.",
+ { title: "Update Cap", okLabel: "Download", cancelLabel: "Later" },
+ )
+ .catch(() => false);
+ if (openDownload) await shell.open("https://cap.so/download");
} finally {
setIsCheckingForUpdates(false);
}