Skip to content

Commit 8358a75

Browse files
committed
Don't let the counter go negative
1 parent 03abbe6 commit 8358a75

File tree

1 file changed

+3
-1
lines changed
  • projects/packages/forms/src/dashboard/inbox

1 file changed

+3
-1
lines changed

projects/packages/forms/src/dashboard/inbox/utils.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ export const updateMenuCounterOptimistically = count => {
6060
optimisticCount = parseInt( item.textContent.replace( /\D/g, '' ), 10 ) + count;
6161
}
6262

63-
updateBadge( item, optimisticCount );
63+
if ( optimisticCount >= 0 ) {
64+
updateBadge( item, optimisticCount );
65+
}
6466
} );
6567
};

0 commit comments

Comments
 (0)