Skip to content

Commit de99ef3

Browse files
committed
Fix auto-dismiss calculation by rounding up intervals.
1 parent e107a94 commit de99ef3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

new-log-viewer/src/components/PopUps/PopUpMessageBox.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ const PopUpMessageBox = ({message}: PopUpMessageProps) => {
5353
return () => {};
5454
}
5555

56-
const totalIntervals = timeoutMillis / AUTO_DISMISS_PERCENT_UPDATE_INTERVAL_MILLIS;
56+
const totalIntervals = Math.ceil(
57+
timeoutMillis / AUTO_DISMISS_PERCENT_UPDATE_INTERVAL_MILLIS
58+
);
5759
const intervalId = setInterval(() => {
5860
intervalCountRef.current++;
5961
const newPercentRemaining = 100 - (100 * (intervalCountRef.current / totalIntervals));

0 commit comments

Comments
 (0)