The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/client/lib/utils/setMessageJumpQueryStringPa...

17 lines
555 B

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: locationPathname,
search: msg ? { ...search, msg } : search,
},
{ replace: true },
);
};