mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-05-20 22:57:14 +02:00
Run oxfmt across repo, add format script and docs
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>
This commit is contained in:
@@ -1,31 +1,31 @@
|
||||
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
||||
import { invoke } from '@tauri-apps/api/core';
|
||||
import { listen } from '@tauri-apps/api/event';
|
||||
import { appInfo } from '@yaakapp/app/lib/appInfo';
|
||||
import { useEffect } from 'react';
|
||||
import { LicenseCheckStatus } from './bindings/license';
|
||||
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { listen } from "@tauri-apps/api/event";
|
||||
import { appInfo } from "@yaakapp/app/lib/appInfo";
|
||||
import { useEffect } from "react";
|
||||
import { LicenseCheckStatus } from "./bindings/license";
|
||||
|
||||
export * from './bindings/license';
|
||||
export * from "./bindings/license";
|
||||
|
||||
const CHECK_QUERY_KEY = ['license.check'];
|
||||
const CHECK_QUERY_KEY = ["license.check"];
|
||||
|
||||
export function useLicense() {
|
||||
const queryClient = useQueryClient();
|
||||
const activate = useMutation<void, string, { licenseKey: string }>({
|
||||
mutationKey: ['license.activate'],
|
||||
mutationFn: (payload) => invoke('plugin:yaak-license|activate', payload),
|
||||
mutationKey: ["license.activate"],
|
||||
mutationFn: (payload) => invoke("plugin:yaak-license|activate", payload),
|
||||
onSuccess: () => queryClient.invalidateQueries({ queryKey: CHECK_QUERY_KEY }),
|
||||
});
|
||||
|
||||
const deactivate = useMutation<void, string, void>({
|
||||
mutationKey: ['license.deactivate'],
|
||||
mutationFn: () => invoke('plugin:yaak-license|deactivate'),
|
||||
mutationKey: ["license.deactivate"],
|
||||
mutationFn: () => invoke("plugin:yaak-license|deactivate"),
|
||||
onSuccess: () => queryClient.invalidateQueries({ queryKey: CHECK_QUERY_KEY }),
|
||||
});
|
||||
|
||||
// Check the license again after a license is activated
|
||||
useEffect(() => {
|
||||
const unlisten = listen('license-activated', async () => {
|
||||
const unlisten = listen("license-activated", async () => {
|
||||
await queryClient.invalidateQueries({ queryKey: CHECK_QUERY_KEY });
|
||||
});
|
||||
return () => {
|
||||
@@ -41,7 +41,7 @@ export function useLicense() {
|
||||
if (!appInfo.featureLicense) {
|
||||
return null;
|
||||
}
|
||||
return invoke<LicenseCheckStatus>('plugin:yaak-license|check');
|
||||
return invoke<LicenseCheckStatus>("plugin:yaak-license|check");
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@yaakapp-internal/license",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"main": "index.ts"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user