From 82d3dd3c7b0b8929312aa2197a0e9acc4a0d3cdd Mon Sep 17 00:00:00 2001 From: janderedev Date: Thu, 12 Aug 2021 22:54:54 +0200 Subject: [PATCH] Scroll to bottom after sed editing message --- src/components/common/messaging/MessageBox.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/common/messaging/MessageBox.tsx b/src/components/common/messaging/MessageBox.tsx index 3f0e1e89..69c6bcab 100644 --- a/src/components/common/messaging/MessageBox.tsx +++ b/src/components/common/messaging/MessageBox.tsx @@ -223,7 +223,13 @@ export default observer(({ channel }: Props) => { if (newContent != msg.content) { msg.edit({ content: newContent.substr(0, 2000), - }).catch(console.warn); + }) + .then(() => + defer(() => + renderer.jumpToBottom(SMOOTH_SCROLL_ON_RECEIVE), + ), + ) + .catch(console.warn); } } } else {