From 33dacbb0cd7b2b7d2e40f65166a0d74a7a3da366 Mon Sep 17 00:00:00 2001 From: GleidsonDaniel Date: Wed, 27 Mar 2024 14:31:12 -0300 Subject: [PATCH] chore: fix React warn (dont call state on unmonted component) --- app/views/RoomView/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/RoomView/index.tsx b/app/views/RoomView/index.tsx index f446d836e..a2d0c5745 100644 --- a/app/views/RoomView/index.tsx +++ b/app/views/RoomView/index.tsx @@ -985,7 +985,9 @@ class RoomView extends React.Component { const { rid } = this.state.room; const { user } = this.props; sendMessage(rid, message, this.tmid, user, tshow).then(() => { - this.setLastOpen(null); + if (this.mounted) { + this.setLastOpen(null); + } Review.pushPositiveEvent(); }); this.resetAction();