File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -334,8 +334,8 @@ const showSpinner = useChatsSpinner()
334334
335335const isMenuOpen = ref (false )
336336
337- // Key for forcing date refresh when app becomes visible after being in background
338337const dateRefreshKey = ref (0 )
338+ const lastVisibleDate = ref (new Date ().toDateString ())
339339
340340const attachments = useAttachments (props .partnerId )()
341341const handleAttachments = (files : FileData []) => {
@@ -526,8 +526,12 @@ onMounted(async () => {
526526 })
527527 visibilityId .value = Visibility .change ((event , state ) => {
528528 if (state === ' visible' ) {
529- // Force refresh dates when returning to visible state
530- dateRefreshKey .value = Date .now ()
529+ const currentDate = new Date ().toDateString ()
530+
531+ if (currentDate !== lastVisibleDate .value ) {
532+ dateRefreshKey .value = Date .now ()
533+ lastVisibleDate .value = currentDate
534+ }
531535
532536 nextTick (() => {
533537 chatRef .value ?.maintainScrollPosition ()
You can’t perform that action at this time.
0 commit comments