Skip to content

Commit fd72464

Browse files
authored
[CLNP-5914] Fixed a GroupChannel UI error when the Open in Channel action is triggered in a different channel. (#1268)
### Changelog * Fixed a GroupChannel UI error when the `Open in Channel` action is triggered in a different channel. * The `Open in Channel` implementation invokes both `setCurrentChannel` and `setStartingPoint`. The `setCurrentChannel` function triggers asynchronous side effects that update `channel`, `messagesDataSource`, and `startingPoint`. If `setStartingPoint` is invoked before these updates are completed, it can result in the channel not being updated correctly or the starting point being improperly set.
1 parent 99aa96c commit fd72464

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/modules/App/DesktopLayout.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,11 @@ export const DesktopLayout: React.FC<DesktopLayoutProps> = (props: DesktopLayout
167167
if (channel?.url !== currentChannel?.url) {
168168
setCurrentChannel(channel);
169169
}
170-
if (message?.messageId !== highlightedMessage) {
171-
setStartingPoint?.(message?.createdAt);
172-
}
170+
setTimeout(() => {
171+
if (message?.messageId !== highlightedMessage) {
172+
setStartingPoint?.(message?.createdAt);
173+
}
174+
}, 200);
173175
setTimeout(() => {
174176
setStartingPoint?.(null);
175177
setHighlightedMessage?.(message?.messageId);

0 commit comments

Comments
 (0)