update dep and bump version

This commit is contained in:
sijie.sun
2024-08-07 21:27:38 +08:00
committed by Sijie.Sun
parent d1293276ce
commit 3e52490d1b
13 changed files with 2454 additions and 2057 deletions

View File

@@ -1,4 +1,4 @@
import { getCurrent } from '@tauri-apps/api/window'
import { getCurrentWindow } from '@tauri-apps/api/window'
import { Menu, MenuItem, PredefinedMenuItem } from '@tauri-apps/api/menu'
import { TrayIcon } from '@tauri-apps/api/tray'
import pkg from '~/../package.json'
@@ -6,11 +6,11 @@ import pkg from '~/../package.json'
const DEFAULT_TRAY_NAME = 'main'
async function toggleVisibility() {
if (await getCurrent().isVisible()) {
await getCurrent().hide()
if (await getCurrentWindow().isVisible()) {
await getCurrentWindow().hide()
} else {
await getCurrent().show()
await getCurrent().setFocus()
await getCurrentWindow().show()
await getCurrentWindow().setFocus()
}
}
@@ -54,7 +54,7 @@ export async function generateMenuItem() {
await MenuItemExit('Exit'),
await PredefinedMenuItem.new({ item: 'Separator' }),
await MenuItemShow('Show / Hide'),
] || []
]
}
export async function MenuItemExit(text: string) {