Skip to content

Commit d54d649

Browse files
authored
Fix: properly handle ConvexError in activity feed flag dialog (#36)
1 parent 00a5e94 commit d54d649

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

apps/web/components/dashboard/activity-feed.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
import { useMutation, usePaginatedQuery } from 'convex/react';
1717
import { api } from '@repo/backend';
1818
import type { Id } from '@repo/backend/_generated/dataModel';
19+
import { ConvexError } from 'convex/values';
1920

2021
import dynamic from 'next/dynamic';
2122
import { RichTextViewer } from '@/components/editor/rich-text-viewer';
@@ -435,6 +436,7 @@ function ActivityCard({
435436
setFlagReason('');
436437
} catch (err) {
437438
setFlagError(
439+
err instanceof ConvexError ? (err.data as string) :
438440
err instanceof Error ? err.message : 'Failed to report activity'
439441
);
440442
} finally {

0 commit comments

Comments
 (0)