fix: Open room from notification click produces errors

This commit is contained in:
Krille Fear 2022-03-20 15:46:03 +01:00
parent b22dbed734
commit d4f0c6c526
2 changed files with 3 additions and 2 deletions

View File

@ -148,6 +148,7 @@ class ChatController extends State<Chat> {
return; return;
} }
setReadMarker(); setReadMarker();
if (!scrollController.hasClients) return;
if (scrollController.position.pixels == if (scrollController.position.pixels ==
scrollController.position.maxScrollExtent && scrollController.position.maxScrollExtent &&
timeline!.events.isNotEmpty && timeline!.events.isNotEmpty &&

View File

@ -289,13 +289,13 @@ class BackgroundPush {
Future<void> goToRoom(String? roomId) async { Future<void> goToRoom(String? roomId) async {
try { try {
Logs().v('[Push] Attempting to go to room $roomId...'); Logs().v('[Push] Attempting to go to room $roomId...');
if (router == null) { if (router == null || roomId == null) {
return; return;
} }
await client.roomsLoading; await client.roomsLoading;
await client.accountDataLoading; await client.accountDataLoading;
final isStory = client final isStory = client
.getRoomById(roomId!) .getRoomById(roomId)
?.getState(EventTypes.RoomCreate) ?.getState(EventTypes.RoomCreate)
?.content ?.content
.tryGet<String>('type') == .tryGet<String>('type') ==