diff --git a/src/services/tauri-db.ts b/src/services/tauri-db.ts index 89c6e73..b5cfd9e 100644 --- a/src/services/tauri-db.ts +++ b/src/services/tauri-db.ts @@ -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(cmd: string, args?: Record): Promise { - 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) } diff --git a/src/stores/workitems.ts b/src/stores/workitems.ts index c58337d..edca0bf 100644 --- a/src/stores/workitems.ts +++ b/src/stores/workitems.ts @@ -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)