File tree Expand file tree Collapse file tree 5 files changed +17
-2
lines changed
packages/client/src/components/common Expand file tree Collapse file tree 5 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ export function ReactionStatistics({
88 upvoters,
99 downvotes = 0 ,
1010 downvoters,
11+ isPending = false ,
1112 onUpvote,
1213 onDownvote,
1314 className
@@ -20,6 +21,7 @@ export function ReactionStatistics({
2021 showCount = { userVote === 'up' }
2122 count = { upvotes }
2223 voters = { upvoters }
24+ isPending = { isPending }
2325 onClick = { onUpvote }
2426 />
2527 < VoteButton
@@ -28,6 +30,7 @@ export function ReactionStatistics({
2830 showCount = { userVote === 'down' }
2931 count = { downvotes }
3032 voters = { downvoters }
33+ isPending = { isPending }
3134 onClick = { onDownvote }
3235 />
3336 </ div >
Original file line number Diff line number Diff line change @@ -37,6 +37,11 @@ export interface ReactionStatisticsProps {
3737 */
3838 onDownvote ?: ( ) => void ;
3939
40+ /**
41+ * Whether a mutation is pending
42+ */
43+ isPending ?: boolean ;
44+
4045 /**
4146 * Additional CSS classes
4247 */
Original file line number Diff line number Diff line change 1- import { formatCaseNumber } from '@carton/shared' ;
1+ import { formatCaseNumber } from '@carton/shared/client ' ;
22import { RelationshipManagerAccordion } from '../RelationshipManagerAccordion/RelationshipManagerAccordion' ;
33
44interface RelatedCasesAccordionProps {
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ export function VoteButton({
99 showCount = true ,
1010 count,
1111 voters,
12+ isPending = false ,
1213 onClick,
1314 className,
1415} : VoteButtonProps ) {
@@ -43,7 +44,8 @@ export function VoteButton({
4344 ) ;
4445
4546 // If voters are provided and there's a count, wrap with tooltip
46- if ( voters && voters . length > 0 && count !== undefined && count > 0 ) {
47+ // Skip tooltip if mutation is pending to avoid showing stale data
48+ if ( voters && voters . length > 0 && count !== undefined && count > 0 && ! isPending ) {
4749 const displayVoters = voters . slice ( 0 , 3 ) ;
4850 const remainingCount = voters . length - 3 ;
4951
Original file line number Diff line number Diff line change @@ -31,6 +31,11 @@ export interface VoteButtonProps {
3131 */
3232 voters ?: string [ ] ;
3333
34+ /**
35+ * Whether a mutation is pending
36+ */
37+ isPending ?: boolean ;
38+
3439 /**
3540 * Click handler for voting interaction
3641 */
You can’t perform that action at this time.
0 commit comments