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)
|
||||
}
|
||||
|
||||
|
||||
@@ -20,9 +20,10 @@ export const useWorkItemsStore = defineStore('workitems', () => {
|
||||
const totalHUs = computed(() => userStories.value.length)
|
||||
const totalEpics = computed(() => epics.value.length)
|
||||
const inProgressHUs = computed(() =>
|
||||
userStories.value.filter(hu =>
|
||||
hu.status && ['in_progress', 'doing', 'wip', 'active', 'in progress'].includes(hu.status.toLowerCase())
|
||||
).length
|
||||
userStories.value.filter(hu => {
|
||||
const s = String(hu.status ?? '').toLowerCase()
|
||||
return ['in_progress', 'doing', 'wip', 'active', 'in progress', 'true'].includes(s)
|
||||
}).length
|
||||
)
|
||||
const totalSessions = computed(() => logbooks.value.length)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user