Skip to content
Merged
5 changes: 5 additions & 0 deletions .changeset/gold-tigers-rhyme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rocket.chat/meteor': patch
---

fix: Jump to message only works once
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import type { IMessage } from '@rocket.chat/core-typings';
import type { LocationPathname } from '@rocket.chat/ui-contexts';

import { router } from '../../providers/RouterProvider';

export const setMessageJumpQueryStringParameter = async (msg: IMessage['_id'] | null) => {
const { msg: _, ...search } = router.getSearchParameters();
const locationPathname = new URL(window.location.href).pathname as LocationPathname;

router.navigate(
{
pathname: router.getLocationPathname(),
pathname: locationPathname,
search: msg ? { ...search, msg } : search,
},
{ replace: true },
Expand Down