Skip to content
Snippets Groups Projects
Unverified Commit e6b6a92f authored by Guilherme Gazzo's avatar Guilherme Gazzo Committed by GitHub
Browse files

Regression: Open Thread (#27640)

parent 4f2895ac
No related merge requests found
......@@ -6,17 +6,18 @@ import { useRoom } from '../../../contexts/RoomContext';
export const useGoToThread = (): ((tmid: IMessage['_id']) => void) => {
const room = useRoom();
const [routeName] = useCurrentRoute();
const [routeName, params] = useCurrentRoute();
if (!routeName) {
throw new Error('Route name is not defined');
}
const roomRoute = useRoute(routeName);
// TODO: remove params recycling
return useCallback(
(tmid) => {
roomRoute.replace({ rid: room._id, ...(room.name && { name: room.name }), tab: 'thread', context: tmid });
roomRoute.replace({ rid: room._id, ...params, tab: 'thread', context: tmid });
},
[room._id, room.name, roomRoute],
[room._id, params, roomRoute],
);
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment