mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-17 22:39:42 +02:00
Merge main into proxy branch (formatting and docs)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
import { useMutation } from '@tanstack/react-query';
|
||||
import { InlineCode } from '@yaakapp-internal/ui';
|
||||
import { showAlert } from '../lib/alert';
|
||||
import { appInfo } from '../lib/appInfo';
|
||||
import { minPromiseMillis } from '../lib/minPromiseMillis';
|
||||
import { invokeCmd } from '../lib/tauri';
|
||||
import { useMutation } from "@tanstack/react-query";
|
||||
import { InlineCode } from "@yaakapp-internal/ui";
|
||||
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'],
|
||||
mutationKey: ["check_for_updates"],
|
||||
mutationFn: async () => {
|
||||
const hasUpdate: boolean = await minPromiseMillis(invokeCmd('cmd_check_for_updates'), 500);
|
||||
const hasUpdate: boolean = await minPromiseMillis(invokeCmd("cmd_check_for_updates"), 500);
|
||||
if (!hasUpdate) {
|
||||
showAlert({
|
||||
id: 'no-updates',
|
||||
title: 'No Update Available',
|
||||
id: "no-updates",
|
||||
title: "No Update Available",
|
||||
body: (
|
||||
<>
|
||||
You are currently on the latest version <InlineCode>{appInfo.version}</InlineCode>
|
||||
|
||||
Reference in New Issue
Block a user