From c7e1530bf43ccfc1e33f960497cc9e56350fa192 Mon Sep 17 00:00:00 2001 From: Neko Ayaka Date: Sun, 29 Jun 2025 11:57:46 +0800 Subject: [PATCH] feat(stage-tamagotchi): use useTauriCore --- apps/stage-tamagotchi/src/pages/index.vue | 4 ++-- apps/stage-tamagotchi/src/utils/windows.ts | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/stage-tamagotchi/src/pages/index.vue b/apps/stage-tamagotchi/src/pages/index.vue index 5bd07a932..1517936d0 100644 --- a/apps/stage-tamagotchi/src/pages/index.vue +++ b/apps/stage-tamagotchi/src/pages/index.vue @@ -4,13 +4,12 @@ import type { AiriTamagotchiEvents, Point, WindowFrame } from '../composables/ta import { WidgetStage } from '@proj-airi/stage-ui/components' import { useMcpStore } from '@proj-airi/stage-ui/stores' import { connectServer } from '@proj-airi/tauri-plugin-mcp' -import { invoke } from '@tauri-apps/api/core' import { storeToRefs } from 'pinia' import { computed, onMounted, onUnmounted, ref } from 'vue' import ResourceStatusIsland from '../components/Widgets/ResourceStatusIsland/index.vue' import { useAppRuntime } from '../composables/runtime' -import { useTauriEvent } from '../composables/tauri' +import { useTauriCore, useTauriEvent } from '../composables/tauri' import { useWindowShortcuts } from '../composables/window-shortcuts' import { useResourcesStore } from '../stores/resources' import { useWindowControlStore } from '../stores/window-controls' @@ -22,6 +21,7 @@ const { platform } = useAppRuntime() const windowStore = useWindowControlStore() const mcpStore = useMcpStore() const { listen } = useTauriEvent() +const { invoke } = useTauriCore() const isCursorInside = ref(false) const { connected, serverCmd, serverArgs } = storeToRefs(mcpStore) diff --git a/apps/stage-tamagotchi/src/utils/windows.ts b/apps/stage-tamagotchi/src/utils/windows.ts index bdb3bd2d2..d50a6417c 100644 --- a/apps/stage-tamagotchi/src/utils/windows.ts +++ b/apps/stage-tamagotchi/src/utils/windows.ts @@ -1,9 +1,11 @@ -import { invoke } from '@tauri-apps/api/core' +import { useTauriCore } from '../composables/tauri' export async function startClickThrough() { + const { invoke } = useTauriCore() await invoke('start_click_through') } export async function stopClickThrough() { + const { invoke } = useTauriCore() await invoke('stop_click_through') }