Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

feat(desktop): pass updater target to check calls

Richie McIlroy914ab75366e7
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 262706a04..4ef71bd09 100644
--- a/apps/desktop/src/routes/(window-chrome)/new-main/index.tsx
+++ b/apps/desktop/src/routes/(window-chrome)/new-main/index.tsx
@@ -77,6 +77,7 @@ import {
type ScreenCaptureTarget,
type UploadProgress,
} from "~/utils/tauri";
+import { getUpdaterCheckOptions } from "~/utils/updater";
import IconCapLogoFull from "~icons/cap/logo-full";
import IconCapLogoFullDark from "~icons/cap/logo-full-dark";
import IconLucideAppWindowMac from "~icons/lucide/app-window-mac";
@@ -1563,7 +1564,7 @@ function createUpdateCheck() {
let update: updater.Update | undefined;
try {
- const result = await updater.check();
+ const result = await updater.check(getUpdaterCheckOptions());
if (result) update = result;
} catch (e) {
console.error("Failed to check for updates:", e);
diff --git a/apps/desktop/src/routes/(window-chrome)/settings.tsx b/apps/desktop/src/routes/(window-chrome)/settings.tsx
index f20539ed7..b848a2daa 100644
--- a/apps/desktop/src/routes/(window-chrome)/settings.tsx
+++ b/apps/desktop/src/routes/(window-chrome)/settings.tsx
@@ -23,6 +23,7 @@ import { SignInButton } from "~/components/SignInButton";
import { authStore, userProfileStore } from "~/store";
import { trackEvent } from "~/utils/analytics";
import { createSignInMutation } from "~/utils/auth";
+import { getUpdaterCheckOptions } from "~/utils/updater";
import {
apiClient,
getConfiguredServerUrl,
@@ -410,7 +411,7 @@ export default function Settings(props: RouteSectionProps) {
setIsCheckingForUpdates(true);
try {
- const update = await check();
+ const update = await check(getUpdaterCheckOptions());
if (!update) {
await dialog.message(
diff --git a/apps/desktop/src/routes/(window-chrome)/update.tsx b/apps/desktop/src/routes/(window-chrome)/update.tsx
index 0ff90cd6c..fe997f645 100644
--- a/apps/desktop/src/routes/(window-chrome)/update.tsx
+++ b/apps/desktop/src/routes/(window-chrome)/update.tsx
@@ -4,6 +4,7 @@ import { getCurrentWindow, UserAttentionType } from "@tauri-apps/api/window";
import { relaunch } from "@tauri-apps/plugin-process";
import { check } from "@tauri-apps/plugin-updater";
import { createResource, createSignal, Match, Show, Switch } from "solid-js";
+import { getUpdaterCheckOptions } from "~/utils/updater";
export default function () {
const navigate = useNavigate();
@@ -11,7 +12,7 @@ export default function () {
const [update] = createResource(async () => {
try {
- const update = await check();
+ const update = await check(getUpdaterCheckOptions());
if (!update) return;
return update;
} catch (e) {