From 2d8f5707d7e19fabc75bb26dfac4d920b7baeaea Mon Sep 17 00:00:00 2001 From: Tasso Date: Tue, 12 Nov 2024 17:57:25 -0300 Subject: [PATCH] Remove outdated cache busting parameter --- apps/meteor/app/emoji-custom/client/lib/emojiCustom.ts | 9 ++------- apps/meteor/app/utils/client/getURL.ts | 8 +++++++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/apps/meteor/app/emoji-custom/client/lib/emojiCustom.ts b/apps/meteor/app/emoji-custom/client/lib/emojiCustom.ts index 0ddf5e6d703d..8b24cd0c29c7 100644 --- a/apps/meteor/app/emoji-custom/client/lib/emojiCustom.ts +++ b/apps/meteor/app/emoji-custom/client/lib/emojiCustom.ts @@ -1,7 +1,6 @@ import type { IEmoji } from '@rocket.chat/core-typings'; import { escapeRegExp } from '@rocket.chat/string-helpers'; import { Meteor } from 'meteor/meteor'; -import { Session } from 'meteor/session'; import { onLoggedIn } from '../../../../client/lib/loggedIn'; import { emoji, removeFromRecent, replaceEmojiInRecent } from '../../../emoji/client'; @@ -19,15 +18,11 @@ const isSetNotNull = (fn: () => unknown) => { }; const getEmojiUrlFromName = (name: string, extension: string, etag?: string) => { - if (name == null) { + if (!name) { return; } - const key = `emoji_random_${name}` as const; - - const random = (Session as unknown as { keys: Record }).keys[key] ?? 0; - - return getURL(`/emoji-custom/${encodeURIComponent(name)}.${extension}?_dc=${random}${etag ? `&etag=${etag}` : ''}`); + return getURL(`/emoji-custom/${encodeURIComponent(name)}.${extension}${etag ? `?etag=${etag}` : ''}`); }; export const deleteEmojiCustom = (emojiData: IEmoji) => { diff --git a/apps/meteor/app/utils/client/getURL.ts b/apps/meteor/app/utils/client/getURL.ts index 040b6dfa9dc2..42970bc38869 100644 --- a/apps/meteor/app/utils/client/getURL.ts +++ b/apps/meteor/app/utils/client/getURL.ts @@ -4,7 +4,13 @@ import { Info } from '../rocketchat.info'; export const getURL = function ( path: string, // eslint-disable-next-line @typescript-eslint/naming-convention - params: Record = {}, + params: { + cdn?: boolean; + full?: boolean; + cloud?: boolean; + cloud_route?: string; + cloud_params?: Record; + } = {}, cloudDeepLinkUrl?: string, cacheKey?: boolean, ): string {