chore: Pause on display receipts

This commit is contained in:
Christian Pauly 2021-12-26 11:40:18 +01:00
parent ee06ead651
commit eba4418c8d

View File

@ -44,11 +44,11 @@ class StoryPageController extends State<StoryPage> {
Event? get currentEvent => index < events.length ? events[index] : null; Event? get currentEvent => index < events.length ? events[index] : null;
bool replyLoading = false; bool replyLoading = false;
bool _emojiSelector = false; bool _modalOpened = false;
void replyEmojiAction() async { void replyEmojiAction() async {
if (replyLoading) return; if (replyLoading) return;
_emojiSelector = true; _modalOpened = true;
await showModalBottomSheet( await showModalBottomSheet(
context: context, context: context,
builder: (context) => EmojiPicker( builder: (context) => EmojiPicker(
@ -58,7 +58,7 @@ class StoryPageController extends State<StoryPage> {
}, },
), ),
); );
_emojiSelector = false; _modalOpened = false;
} }
void replyAction([String? message]) async { void replyAction([String? message]) async {
@ -103,7 +103,9 @@ class StoryPageController extends State<StoryPage> {
[]; [];
} }
void displaySeenByUsers() => showModalBottomSheet( void displaySeenByUsers() async {
_modalOpened = true;
await showModalBottomSheet(
context: context, context: context,
builder: (context) => Scaffold( builder: (context) => Scaffold(
appBar: AppBar( appBar: AppBar(
@ -121,6 +123,8 @@ class StoryPageController extends State<StoryPage> {
), ),
), ),
); );
_modalOpened = false;
}
String get seenByUsersTitle { String get seenByUsersTitle {
final seenByUsers = currentSeenByUsers; final seenByUsers = currentSeenByUsers;
@ -147,7 +151,7 @@ class StoryPageController extends State<StoryPage> {
_progressTimer?.cancel(); _progressTimer?.cancel();
if (reset) progress = Duration.zero; if (reset) progress = Duration.zero;
_progressTimer = Timer.periodic(_step, (_) { _progressTimer = Timer.periodic(_step, (_) {
if (replyFocus.hasFocus || _emojiSelector) return; if (replyFocus.hasFocus || _modalOpened) return;
if (!mounted) { if (!mounted) {
_progressTimer?.cancel(); _progressTimer?.cancel();
return; return;