Skip to content

Commit 9d6113a

Browse files
refactor: drop un-used utilities around pending tasks
1 parent 49e37d1 commit 9d6113a

File tree

3 files changed

+5
-112
lines changed

3 files changed

+5
-112
lines changed

package/src/components/Channel/Channel.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ import * as dbApi from '../../store/apis';
7979
import type { DefaultStreamChatGenerics } from '../../types/types';
8080
import { addReactionToLocalState } from '../../utils/addReactionToLocalState';
8181
import { DBSyncManager } from '../../utils/DBSyncManager';
82-
import { dropPendingTasks, queueTask } from '../../utils/pendingTaskUtils';
8382
import { removeReactionFromLocalState } from '../../utils/removeReactionFromLocalState';
8483
import { generateRandomId, isLocalUrl, MessageStatusTypes, ReactionData } from '../../utils/utils';
8584
import { Attachment as AttachmentDefault } from '../Attachment/Attachment';
@@ -1591,7 +1590,7 @@ const ChannelWithContext = <
15911590

15921591
setMessages(channel.state.messages);
15931592

1594-
await queueTask<StreamChatGenerics>({
1593+
await DBSyncManager.queueTask<StreamChatGenerics>({
15951594
client,
15961595
task: {
15971596
channelId: channel.id,
@@ -1615,7 +1614,7 @@ const ChannelWithContext = <
16151614
}
16161615

16171616
if (message.status === MessageStatusTypes.FAILED) {
1618-
dropPendingTasks({ messageId: message.id });
1617+
DBSyncManager.dropPendingTasks({ messageId: message.id });
16191618
removeMessage(message);
16201619
} else {
16211620
updateMessage({
@@ -1625,7 +1624,7 @@ const ChannelWithContext = <
16251624
type: 'deleted',
16261625
});
16271626

1628-
const data = await queueTask<StreamChatGenerics>({
1627+
const data = await DBSyncManager.queueTask<StreamChatGenerics>({
16291628
client,
16301629
task: {
16311630
channelId: channel.id,
@@ -1666,7 +1665,7 @@ const ChannelWithContext = <
16661665

16671666
setMessages(channel.state.messages);
16681667

1669-
await queueTask({
1668+
await DBSyncManager.queueTask<StreamChatGenerics>({
16701669
client,
16711670
task: {
16721671
channelId: channel.id,

package/src/utils/DBSyncManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ export class DBSyncManager {
208208
}
209209
};
210210

211-
dropPendingTasks = (conditions: { messageId: string }) => {
211+
static dropPendingTasks = (conditions: { messageId: string }) => {
212212
const tasks = getPendingTasks(conditions);
213213

214214
for (const task of tasks) {

package/src/utils/pendingTaskUtils.ts

Lines changed: 0 additions & 106 deletions
This file was deleted.

0 commit comments

Comments
 (0)