Skip to content

Commit

Permalink
Remove outdated cache busting parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
tassoevan committed Nov 12, 2024
1 parent 20763ac commit 2d8f570
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
9 changes: 2 additions & 7 deletions apps/meteor/app/emoji-custom/client/lib/emojiCustom.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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<string, any> }).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) => {
Expand Down
8 changes: 7 additions & 1 deletion apps/meteor/app/utils/client/getURL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, any> = {},
params: {
cdn?: boolean;
full?: boolean;
cloud?: boolean;
cloud_route?: string;
cloud_params?: Record<string, string>;
} = {},
cloudDeepLinkUrl?: string,
cacheKey?: boolean,
): string {
Expand Down

0 comments on commit 2d8f570

Please sign in to comment.