Rocket.Chat/apps/meteor/client/lib/utils/legacyJumpToMessage.ts
Abhinav Kumar 25a10b65bc
Some checks are pending
Deploy GitHub Pages / deploy-preview (push) Waiting to run
CI / ⚙️ Variables Setup (push) Waiting to run
CI / 🚀 Notify external services - draft (push) Blocked by required conditions
CI / 📦 Build Packages (push) Blocked by required conditions
CI / 📦 Meteor Build (${{ matrix.type }}) (coverage) (push) Blocked by required conditions
CI / 📦 Meteor Build (${{ matrix.type }}) (production) (push) Blocked by required conditions
CI / 🚢 Build Docker (amd64, [account-service presence-service stream-hub-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Blocked by required conditions
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Blocked by required conditions
CI / 🚢 Build Docker (amd64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Blocked by required conditions
CI / 🚢 Build Docker (amd64, [rocketchat], coverage) (push) Blocked by required conditions
CI / 🚢 Build Docker (arm64, [account-service presence-service stream-hub-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Blocked by required conditions
CI / 🚢 Build Docker (arm64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Blocked by required conditions
CI / 🚢 Build Docker (arm64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Blocked by required conditions
CI / 🚢 Build Docker (arm64, [rocketchat], coverage) (push) Blocked by required conditions
CI / 🚢 Publish Docker Images (ghcr.io) (push) Blocked by required conditions
CI / 📦 Track Image Sizes (push) Blocked by required conditions
CI / 🔎 Code Check (push) Blocked by required conditions
CI / 🔨 Test Storybook (push) Blocked by required conditions
CI / 🔨 Test Unit (push) Blocked by required conditions
CI / 🔨 Test API (CE) (push) Blocked by required conditions
CI / 🔨 Test UI (CE) (push) Blocked by required conditions
CI / 🔨 Test API (EE) (push) Blocked by required conditions
CI / 🔨 Test UI (EE) (push) Blocked by required conditions
CI / 🔨 Test Federation Matrix (push) Blocked by required conditions
CI / 📊 Report Coverage (push) Blocked by required conditions
CI / ✅ Tests Done (push) Blocked by required conditions
CI / 🚀 Publish build assets (push) Blocked by required conditions
CI / 🚀 Publish Docker Images (DockerHub) (push) Blocked by required conditions
CI / 🚀 Notify external services (push) Blocked by required conditions
CI / Update Version Durability (push) Blocked by required conditions
Code scanning - action / CodeQL-Build (push) Waiting to run
fix: Global Search "Jump to message" failing due to incorrect URL generation (#37717)
Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com>
2025-12-19 04:31:10 +00:00

35 lines
1.1 KiB
TypeScript

import type { IMessage } from '@rocket.chat/core-typings';
import { isThreadMessage } from '@rocket.chat/core-typings';
import { goToRoomById } from './goToRoomById';
import { RoomHistoryManager } from '../../../app/ui-utils/client';
import { router } from '../../providers/RouterProvider';
import { RoomManager } from '../RoomManager';
/** @deprecated */
export const legacyJumpToMessage = async (message: IMessage) => {
if (isThreadMessage(message) || message.tcount) {
const { tab, context } = router.getRouteParameters();
if (tab === 'thread' && (context === message.tmid || context === message._id)) {
return;
}
await goToRoomById(message.rid, {
routeParamsOverrides: { tab: 'thread', context: message.tmid || message._id },
replace: RoomManager.opened === message.rid,
});
await RoomHistoryManager.getSurroundingMessages(message);
return;
}
if (RoomManager.opened === message.rid) {
await RoomHistoryManager.getSurroundingMessages(message);
return;
}
await goToRoomById(message.rid);
await RoomHistoryManager.getSurroundingMessages(message);
};