Skip to content

Commit c61a5fe

Browse files
committed
fix: show sync error on client detail page, don't silently swallow
1 parent 20cb87c commit c61a5fe

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

apps/observatory/src/pages/ClientDetailPage.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,16 @@ export const ClientDetailPage: React.FC = () => {
8585
setUnassigningAgent(null);
8686
};
8787

88+
const [syncError, setSyncError] = useState<string | null>(null);
89+
8890
const handleSync = async () => {
8991
setSyncing(true);
90-
await triggerImport();
92+
setSyncError(null);
93+
const result = await triggerImport();
9194
setSyncing(false);
95+
if (!result.ok) {
96+
setSyncError(result.error || 'Sync failed');
97+
}
9298
};
9399

94100
return (
@@ -136,6 +142,13 @@ export const ClientDetailPage: React.FC = () => {
136142
</div>
137143
</motion.div>
138144

145+
{/* Sync error */}
146+
{syncError && (
147+
<motion.div variants={fadeUp} className="bg-[#FDF0F0] border border-[#F0C6C6] text-[#C23A3A] rounded-lg p-3 mb-4 text-sm flex items-center gap-2">
148+
<AlertTriangle className="w-4 h-4 flex-shrink-0" /> {syncError}
149+
</motion.div>
150+
)}
151+
139152
{/* QB Company Info */}
140153
{company && (
141154
<motion.div variants={fadeUp} className="bg-white border border-[#E8E5DE] rounded-lg p-4 mb-4 shadow-[0_1px_2px_rgba(26,24,20,0.04)]">

0 commit comments

Comments
 (0)