corregir recursion infinita en safeInvoke + status.toLowerCase con booleans

This commit is contained in:
2026-05-27 20:29:30 -05:00
parent f6268bbdf1
commit 9898d4a414
2 changed files with 10 additions and 5 deletions
+6 -2
View File
@@ -1,9 +1,13 @@
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> { 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.`) 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 Promise.resolve(null as unknown as T)
}
return _invoke(cmd, args)
} }
return safeInvoke(cmd, args) return safeInvoke(cmd, args)
} }
+4 -3
View File
@@ -20,9 +20,10 @@ export const useWorkItemsStore = defineStore('workitems', () => {
const totalHUs = computed(() => userStories.value.length) const totalHUs = computed(() => userStories.value.length)
const totalEpics = computed(() => epics.value.length) const totalEpics = computed(() => epics.value.length)
const inProgressHUs = computed(() => const inProgressHUs = computed(() =>
userStories.value.filter(hu => userStories.value.filter(hu => {
hu.status && ['in_progress', 'doing', 'wip', 'active', 'in progress'].includes(hu.status.toLowerCase()) const s = String(hu.status ?? '').toLowerCase()
).length return ['in_progress', 'doing', 'wip', 'active', 'in progress', 'true'].includes(s)
}).length
) )
const totalSessions = computed(() => logbooks.value.length) const totalSessions = computed(() => logbooks.value.length)