mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-25 02:41:21 +01:00
Add .oxfmtignore to skip generated bindings and wasm-pack output. Add npm format script, update DEVELOPMENT.md for Vite+ toolchain, and format all non-generated files with oxfmt. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
27 lines
836 B
TypeScript
27 lines
836 B
TypeScript
import { useMutation } from "@tanstack/react-query";
|
|
import { InlineCode } from "../components/core/InlineCode";
|
|
import { showAlert } from "../lib/alert";
|
|
import { appInfo } from "../lib/appInfo";
|
|
import { minPromiseMillis } from "../lib/minPromiseMillis";
|
|
import { invokeCmd } from "../lib/tauri";
|
|
|
|
export function useCheckForUpdates() {
|
|
return useMutation({
|
|
mutationKey: ["check_for_updates"],
|
|
mutationFn: async () => {
|
|
const hasUpdate: boolean = await minPromiseMillis(invokeCmd("cmd_check_for_updates"), 500);
|
|
if (!hasUpdate) {
|
|
showAlert({
|
|
id: "no-updates",
|
|
title: "No Update Available",
|
|
body: (
|
|
<>
|
|
You are currently on the latest version <InlineCode>{appInfo.version}</InlineCode>
|
|
</>
|
|
),
|
|
});
|
|
}
|
|
},
|
|
});
|
|
}
|