Skip to content

Commit

Permalink
[TW-1482] Sometime Timestamp is disappear when scrolling (#1502)
Browse files Browse the repository at this point in the history
  • Loading branch information
Te-Z authored Feb 26, 2024
1 parent 89fee0e commit 2e5f258
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ prime
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
.vscode/

# Flutter/Dart/Pub related
**/doc/api/
Expand Down
11 changes: 8 additions & 3 deletions lib/pages/chat/chat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1605,21 +1605,26 @@ class ChatController extends State<Chat>
deltaBottomReversed > viewPortDimension - stickyTimestampHeight;
}

Timer? _timestampTimer;

void _handleHideStickyTimestamp() {
Logs().d('Chat::_handleHideStickyTimestamp() - Hide sticky timestamp');
stickyTimestampNotifier.value = null;
}

void handleScrollEndNotification() async {
void handleScrollEndNotification() {
Logs().d('Chat::handleScrollEndNotification() - End of scroll');
if (PlatformInfos.isMobile) {
_timestampTimer?.cancel();
_currentChatScrollState = ChatScrollState.endScroll;
await Future.delayed(_delayHideStickyTimestampHeader);
_handleHideStickyTimestamp();
_timestampTimer =
Timer(_delayHideStickyTimestampHeader, _handleHideStickyTimestamp);
}
}

void handleScrollStartNotification() {
Logs().d('Chat::handleScrollStartNotification() - Start of scroll');
if (PlatformInfos.isMobile) _timestampTimer?.cancel();
_currentChatScrollState = ChatScrollState.startScroll;
}

Expand Down

0 comments on commit 2e5f258

Please sign in to comment.