Skip to content

Commit

Permalink
Regression: Fix go to ThreadList hook
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo authored Dec 28, 2022
1 parent 12cb1c8 commit 299ba0e
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { useRoom } from '../../../contexts/RoomContext';

export const useGoToThreadList = (): (() => void) => {
const room = useRoom();
const [routeName] = useCurrentRoute();
const [routeName, { context, ...params } = { context: '' }] = useCurrentRoute();

if (!routeName) {
throw new Error('Route name is not defined');
}

const roomRoute = useRoute(routeName);
return useCallback(() => {
roomRoute.replace({ rid: room._id, ...(room.name && { name: room.name }), tab: 'thread' });
}, [room._id, room.name, roomRoute]);
roomRoute.replace({ rid: room._id, ...params, tab: 'thread' });
}, [room._id, roomRoute, params]);
};

0 comments on commit 299ba0e

Please sign in to comment.