feat(stage-tamagotchi): use useTauriCore
This commit is contained in:
@@ -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<AiriTamagotchiEvents>()
|
||||
const { invoke } = useTauriCore()
|
||||
|
||||
const isCursorInside = ref(false)
|
||||
const { connected, serverCmd, serverArgs } = storeToRefs(mcpStore)
|
||||
|
||||
@@ -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')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user