Skip to content

Commit

Permalink
Remove message template
Browse files Browse the repository at this point in the history
  • Loading branch information
tassoevan committed Feb 14, 2023
1 parent 018e3a6 commit 2ede6c8
Show file tree
Hide file tree
Showing 29 changed files with 43 additions and 1,607 deletions.
3 changes: 0 additions & 3 deletions apps/meteor/app/oembed/client/baseWidget.html

This file was deleted.

27 changes: 0 additions & 27 deletions apps/meteor/app/oembed/client/baseWidget.js

This file was deleted.

11 changes: 0 additions & 11 deletions apps/meteor/app/oembed/client/index.ts

This file was deleted.

16 changes: 0 additions & 16 deletions apps/meteor/app/oembed/client/oembedAudioWidget.html

This file was deleted.

30 changes: 0 additions & 30 deletions apps/meteor/app/oembed/client/oembedFrameWidget.html

This file was deleted.

19 changes: 0 additions & 19 deletions apps/meteor/app/oembed/client/oembedImageWidget.html

This file was deleted.

16 changes: 0 additions & 16 deletions apps/meteor/app/oembed/client/oembedImageWidget.js

This file was deleted.

32 changes: 0 additions & 32 deletions apps/meteor/app/oembed/client/oembedUrlWidget.html

This file was deleted.

64 changes: 0 additions & 64 deletions apps/meteor/app/oembed/client/oembedUrlWidget.js

This file was deleted.

15 changes: 0 additions & 15 deletions apps/meteor/app/oembed/client/oembedVideoWidget.html

This file was deleted.

30 changes: 0 additions & 30 deletions apps/meteor/app/oembed/client/oembedVideoWidget.js

This file was deleted.

12 changes: 0 additions & 12 deletions apps/meteor/app/oembed/client/oembedYoutubeWidget.html

This file was deleted.

41 changes: 41 additions & 0 deletions apps/meteor/app/ui-message/client/findParentMessage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import type { IMessage } from '@rocket.chat/core-typings';

import { callWithErrorHandling } from '../../../client/lib/utils/callWithErrorHandling';
import { ChatMessage } from '../../models/client';
import { withDebouncing } from '../../../lib/utils/highOrderFunctions';

export const findParentMessage = (() => {
const waiting: string[] = [];
let resolve: (resolved: IMessage[] | PromiseLike<IMessage[]>) => void;
let pending = new Promise<IMessage[]>((r) => {
resolve = r;
});

const getMessages = withDebouncing({ wait: 500 })(async function () {
const _tmp = [...waiting];
waiting.length = 0;
resolve(callWithErrorHandling('getMessages', _tmp));
pending = new Promise<IMessage[]>((r) => {
resolve = r;
});
});

const get = async (tmid: IMessage['_id']) => {
getMessages();
const messages = await pending;
return messages.find(({ _id }) => _id === tmid);
};

return async (tmid: IMessage['_id']) => {
const message = ChatMessage.findOne({ _id: tmid });

if (message) {
return message;
}

if (waiting.indexOf(tmid) === -1) {
waiting.push(tmid);
}
return get(tmid);
};
})();
2 changes: 0 additions & 2 deletions apps/meteor/app/ui-message/client/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import './message';
// import './messageBox/messageBox.ts';
import './popup/customMessagePopups';
import './popup/messagePopup';
import './popup/messagePopupChannel';
Expand Down
Loading

0 comments on commit 2ede6c8

Please sign in to comment.