File tree Expand file tree Collapse file tree 3 files changed +7
-12
lines changed
Expand file tree Collapse file tree 3 files changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import { formatElapsedTime } from '../utils/format-elapsed-time'
77interface ElapsedTimerProps {
88 startTime : number | null
99 suffix ?: string
10- attributes ?: number
10+ attributes ?: TextAttributes
1111}
1212
1313/**
@@ -20,14 +20,9 @@ export const ElapsedTimer = ({
2020 attributes,
2121} : ElapsedTimerProps ) => {
2222 const theme = useTheme ( )
23-
24- // Calculate elapsed seconds synchronously for SSR/initial render
25- const calculateElapsed = ( ) => {
26- if ( ! startTime ) return 0
27- return Math . floor ( ( Date . now ( ) - startTime ) / 1000 )
28- }
29-
30- const [ elapsedSeconds , setElapsedSeconds ] = useState < number > ( calculateElapsed )
23+ const [ elapsedSeconds , setElapsedSeconds ] = useState < number > ( ( ) =>
24+ startTime ? Math . floor ( ( Date . now ( ) - startTime ) / 1000 ) : 0 ,
25+ )
3126
3227 useEffect ( ( ) => {
3328 if ( ! startTime ) {
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ export const ImageCard = ({
108108 { /* Thumbnail or icon area */ }
109109 < box
110110 style = { {
111- height : 3 ,
111+ height : THUMBNAIL_HEIGHT ,
112112 justifyContent : 'center' ,
113113 alignItems : 'center' ,
114114 } }
Original file line number Diff line number Diff line change @@ -98,9 +98,9 @@ const MessageAttachments = ({
9898 marginTop : 1 ,
9999 } }
100100 >
101- { attachments . map ( ( attachment , index ) => (
101+ { attachments . map ( ( attachment ) => (
102102 < ImageCard
103- key = { ` ${ attachment . path } - ${ index } ` }
103+ key = { attachment . path }
104104 image = { attachment }
105105 showRemoveButton = { false }
106106 />
You can’t perform that action at this time.
0 commit comments