修复所有lint警告和错误

This commit is contained in:
xintaofei
2026-03-26 21:47:13 +08:00
parent 5e5c48338b
commit f61f9fb025
20 changed files with 138 additions and 93 deletions

View File

@@ -24,9 +24,7 @@ export async function subscribe<T>(
*/
export async function openUrl(url: string): Promise<void> {
if (isDesktop()) {
const { openUrl: tauriOpenUrl } = await import(
"@tauri-apps/plugin-opener"
)
const { openUrl: tauriOpenUrl } = await import("@tauri-apps/plugin-opener")
await tauriOpenUrl(url)
} else {
window.open(url, "_blank")
@@ -39,9 +37,8 @@ export async function openUrl(url: string): Promise<void> {
*/
export async function openPath(path: string): Promise<void> {
if (isDesktop()) {
const { openPath: tauriOpenPath } = await import(
"@tauri-apps/plugin-opener"
)
const { openPath: tauriOpenPath } =
await import("@tauri-apps/plugin-opener")
await tauriOpenPath(path)
}
}
@@ -52,9 +49,8 @@ export async function openPath(path: string): Promise<void> {
*/
export async function revealItemInDir(path: string): Promise<void> {
if (isDesktop()) {
const { revealItemInDir: tauriReveal } = await import(
"@tauri-apps/plugin-opener"
)
const { revealItemInDir: tauriReveal } =
await import("@tauri-apps/plugin-opener")
await tauriReveal(path)
}
}
@@ -101,9 +97,8 @@ export async function openFileDialog(options?: {
*/
export async function getCurrentWindow() {
if (isDesktop()) {
const { getCurrentWindow: tauriGetCurrentWindow } = await import(
"@tauri-apps/api/window"
)
const { getCurrentWindow: tauriGetCurrentWindow } =
await import("@tauri-apps/api/window")
return tauriGetCurrentWindow()
}
return null