Skip to content

Commit

Permalink
reset sendable status after sending a message and clearing the input
Browse files Browse the repository at this point in the history
  • Loading branch information
ereio committed Oct 28, 2020
1 parent c7f18f6 commit 5a2b5ce
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/views/home/chat/index.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import 'package:syphon/global/colours.dart';
import 'package:syphon/global/dimensions.dart';
import 'package:syphon/global/strings.dart';
import 'package:syphon/global/themes.dart';
import 'package:syphon/store/auth/actions.dart';
import 'package:syphon/store/crypto/actions.dart';
import 'package:syphon/store/index.dart';
import 'package:syphon/store/rooms/actions.dart';
Expand All @@ -31,7 +30,6 @@ import 'package:syphon/store/rooms/events/selectors.dart';
import 'package:syphon/store/rooms/room/model.dart';
import 'package:syphon/store/rooms/selectors.dart' as roomSelectors;
import 'package:syphon/views/home/chat/chat-input.dart';
import 'package:syphon/views/home/chat/details-message.dart';
import 'package:syphon/views/home/chat/dialog-encryption.dart';
import 'package:syphon/views/home/chat/dialog-invite.dart';
import 'package:syphon/views/widgets/appbars/appbar-chat.dart';
Expand Down Expand Up @@ -144,13 +142,11 @@ class ChatViewState extends State<ChatView> {
final atLimit = Platform.isAndroid ? limit < 1 : limit < -32;

if (atLimit && !loadMore) {
debugPrint('[messagesController.addListener] loading set to true');
this.setState(() {
loadMore = true;
});
props.onLoadMoreMessages();
} else if (!atLimit && loadMore && !props.loading) {
debugPrint('[messagesController.addListener] loading set to false');
this.setState(() {
loadMore = false;
});
Expand Down Expand Up @@ -317,6 +313,9 @@ class ChatViewState extends State<ChatView> {
);
editorController.clear();
FocusScope.of(context).unfocus();
this.setState(() {
sendable = false;
});
}

@protected
Expand Down

0 comments on commit 5a2b5ce

Please sign in to comment.