forked from imbytecat/fullstack-starter
refactor(desktop): 从 Tauri 迁移到 Electrobun
- 移除 Tauri v2 代码 (src-tauri/, copy.ts) - 添加 Electrobun 配置和入口 (electrobun.config.ts, src/bun/index.ts) - 更新 package.json 使用 catalog 管理 electrobun 依赖 - 移除 server 中的 @tauri-apps/api 依赖 - 更新 AGENTS.md 文档
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
import { useMutation, useSuspenseQuery } from '@tanstack/react-query'
|
||||
import { createFileRoute } from '@tanstack/react-router'
|
||||
import { isTauri } from '@tauri-apps/api/core'
|
||||
import { getCurrentWindow } from '@tauri-apps/api/window'
|
||||
import type { ChangeEventHandler, FormEventHandler } from 'react'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useState } from 'react'
|
||||
import { orpc } from '@/client/query-client'
|
||||
|
||||
export const Route = createFileRoute('/')({
|
||||
@@ -21,11 +19,6 @@ function Todos() {
|
||||
const updateMutation = useMutation(orpc.todo.update.mutationOptions())
|
||||
const deleteMutation = useMutation(orpc.todo.remove.mutationOptions())
|
||||
|
||||
useEffect(() => {
|
||||
if (!isTauri()) return
|
||||
getCurrentWindow().setTitle('待办事项')
|
||||
}, [])
|
||||
|
||||
const handleCreateTodo: FormEventHandler<HTMLFormElement> = (e) => {
|
||||
e.preventDefault()
|
||||
if (newTodoTitle.trim()) {
|
||||
|
||||
Reference in New Issue
Block a user