corregir recursion infinita en safeInvoke + status.toLowerCase con booleans
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
import { invoke } from '@tauri-apps/api/core'
|
||||
import { invoke as tauriInvoke } from '@tauri-apps/api/core'
|
||||
|
||||
const _invoke = typeof tauriInvoke === 'function' ? tauriInvoke : undefined
|
||||
|
||||
function safeInvoke<T>(cmd: string, args?: Record<string, unknown>): Promise<T> {
|
||||
if (typeof invoke !== 'function') {
|
||||
if (!_invoke) {
|
||||
console.warn(`[Alpha] Tauri invoke no disponible (${cmd}). ¿Estás en un navegador externo? Usá la ventana de Tauri.`)
|
||||
return Promise.resolve(null as unknown as T)
|
||||
}
|
||||
return _invoke(cmd, args)
|
||||
}
|
||||
return safeInvoke(cmd, args)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user