From 9ca012f75ae67b2f32764a09682de6181e2346b3 Mon Sep 17 00:00:00 2001 From: Nemo Date: Tue, 24 Mar 2026 16:41:43 +0800 Subject: [PATCH] fix: [BLOCKER] status-change comments marked isSystemMessage to prevent auto-reopen --- app/(app)/tasks/[id].tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/(app)/tasks/[id].tsx b/app/(app)/tasks/[id].tsx index f3174e7..27c8b93 100644 --- a/app/(app)/tasks/[id].tsx +++ b/app/(app)/tasks/[id].tsx @@ -96,6 +96,7 @@ export default function TicketDetailScreen() { const who = user?.firstName ?? 'Staff'; await api.post(`/api/v1/tickets/${id}/messages`, { body: `Status changed to ${status.replace('_', ' ')} by ${who}`, + isSystemMessage: true, }).catch(() => {}); return updatedTicket; @@ -156,11 +157,15 @@ export default function TicketDetailScreen() { const note = instNotes.trim() ? `Installation confirmed. Location recorded: ${coordStr}. Notes: ${instNotes.trim()}` : `Installation confirmed. Location recorded: ${coordStr}`; - await api.post(`/api/v1/tickets/${id}/messages`, { body: note }).catch(() => {}); + await api.post(`/api/v1/tickets/${id}/messages`, { body: note, isSystemMessage: true }).catch(() => {}); // 4. Generate first invoice so it appears in Collect screen if (ticket?.clientId) { - await api.post(`/api/v1/invoices/generate/${ticket.clientId}`).catch(() => {}); + try { + await api.post(`/api/v1/invoices/generate/${ticket.clientId}`); + } catch (e: any) { + console.warn('Invoice generation failed:', e?.response?.data?.message ?? e?.message); + } } // 5. Create follow-up activation ticket (non-fatal)