add more mounted checks to room chat controller
This commit is contained in:
parent
22d615a3c8
commit
2b0e8fb819
1 changed files with 4 additions and 0 deletions
|
|
@ -295,6 +295,7 @@ class RoomChatController(final ChatParams info)
|
||||||
: null,
|
: null,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
if (!ref.mounted) return;
|
||||||
|
|
||||||
if (response.events.isEmpty) {
|
if (response.events.isEmpty) {
|
||||||
state = .data(chat);
|
state = .data(chat);
|
||||||
|
|
@ -333,6 +334,7 @@ class RoomChatController(final ChatParams info)
|
||||||
: chat!.historicalData!.start,
|
: chat!.historicalData!.start,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
if (!ref.mounted) return;
|
||||||
|
|
||||||
ref
|
ref
|
||||||
.read(RoomsController.provider.notifier)
|
.read(RoomsController.provider.notifier)
|
||||||
|
|
@ -345,6 +347,7 @@ class RoomChatController(final ChatParams info)
|
||||||
final rootRowId = direction == .backward
|
final rootRowId = direction == .backward
|
||||||
? await threadRootBefore(paginationResponse)
|
? await threadRootBefore(paginationResponse)
|
||||||
: null;
|
: null;
|
||||||
|
if (!ref.mounted) return;
|
||||||
final eventRowIds = [
|
final eventRowIds = [
|
||||||
?rootRowId,
|
?rootRowId,
|
||||||
...(direction == .forward
|
...(direction == .forward
|
||||||
|
|
@ -383,6 +386,7 @@ class RoomChatController(final ChatParams info)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
|
if (!ref.mounted) return;
|
||||||
state = .data(chat);
|
state = .data(chat);
|
||||||
rethrow;
|
rethrow;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue