bulbul-chat
Advanced tools
Comparing version 2.9.2 to 2.9.3
{ | ||
"name": "bulbul-chat", | ||
"version": "2.9.2", | ||
"version": "2.9.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -34,3 +34,3 @@ import ChannelMessageStorage from './ChannelMessageStorage'; | ||
sendAttachment(channelId: string, messageType: ChatMessageType, content: string, file: any, replyTo?: ChatMessage | null): Promise<void>; | ||
loadEarlier(channelId: string): void; | ||
loadEarlier(channelId: string): Promise<void>; | ||
loadLater(channelId: string): Promise<void>; | ||
@@ -37,0 +37,0 @@ getUser(id: string): Promise<ChatUser>; |
@@ -534,4 +534,9 @@ "use strict"; | ||
ChatService.prototype.loadEarlier = function (channelId) { | ||
var channelMessageStorage = this.channelMessageStorage(channelId); | ||
channelMessageStorage.loadEarlier(this.chatClient); | ||
return __awaiter(this, void 0, void 0, function () { | ||
var channelMessageStorage; | ||
return __generator(this, function (_a) { | ||
channelMessageStorage = this.channelMessageStorage(channelId); | ||
return [2 /*return*/, channelMessageStorage.loadEarlier(this.chatClient)]; | ||
}); | ||
}); | ||
}; | ||
@@ -543,4 +548,3 @@ ChatService.prototype.loadLater = function (channelId) { | ||
channelMessageStorage = this.channelMessageStorage(channelId); | ||
channelMessageStorage.loadLater(this.chatClient); | ||
return [2 /*return*/]; | ||
return [2 /*return*/, channelMessageStorage.loadLater(this.chatClient)]; | ||
}); | ||
@@ -547,0 +551,0 @@ }); |
@@ -102,10 +102,16 @@ "use strict"; | ||
var _d = react_1.default.useState([]), currentUnsubscriptions = _d[0], setCurrentUnsubscriptions = _d[1]; | ||
var loadEarlier = react_1.useCallback(function () { | ||
if (state.channel) | ||
chatService.loadEarlier(state.channel.id); | ||
}, [state.channel, chatService]); | ||
var loadLater = react_1.useCallback(function () { | ||
if (state.channel) | ||
chatService.loadLater(state.channel.id); | ||
}, [state.channel, chatService]); | ||
var loadEarlier = react_1.useCallback(function () { return __awaiter(void 0, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
if (state.channel) | ||
return [2 /*return*/, chatService.loadEarlier(state.channel.id)]; | ||
return [2 /*return*/]; | ||
}); | ||
}); }, [state.channel, chatService]); | ||
var loadLater = react_1.useCallback(function () { return __awaiter(void 0, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
if (state.channel) | ||
return [2 /*return*/, chatService.loadLater(state.channel.id)]; | ||
return [2 /*return*/]; | ||
}); | ||
}); }, [state.channel, chatService]); | ||
// let websocket listen to channel messages and subscribe to new new messages | ||
@@ -112,0 +118,0 @@ react_1.default.useEffect(function () { |
{ | ||
"name": "bulbul-chat", | ||
"version": "2.9.2", | ||
"version": "2.9.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -478,5 +478,5 @@ import { diffInSeconds } from './utils'; | ||
loadEarlier(channelId: string) { | ||
async loadEarlier(channelId: string) { | ||
const channelMessageStorage = this.channelMessageStorage(channelId); | ||
channelMessageStorage.loadEarlier(this.chatClient); | ||
return channelMessageStorage.loadEarlier(this.chatClient); | ||
} | ||
@@ -486,3 +486,3 @@ | ||
const channelMessageStorage = this.channelMessageStorage(channelId); | ||
channelMessageStorage.loadLater(this.chatClient); | ||
return channelMessageStorage.loadLater(this.chatClient); | ||
} | ||
@@ -489,0 +489,0 @@ |
@@ -75,7 +75,7 @@ import { diffInSeconds } from './utils'; | ||
>([]); | ||
const loadEarlier = useCallback(() => { | ||
if (state.channel) chatService.loadEarlier(state.channel.id); | ||
const loadEarlier = useCallback(async () => { | ||
if (state.channel) return chatService.loadEarlier(state.channel.id); | ||
}, [state.channel, chatService]); | ||
const loadLater = useCallback(() => { | ||
if (state.channel) chatService.loadLater(state.channel.id); | ||
const loadLater = useCallback(async () => { | ||
if (state.channel) return chatService.loadLater(state.channel.id); | ||
}, [state.channel, chatService]); | ||
@@ -82,0 +82,0 @@ // let websocket listen to channel messages and subscribe to new new messages |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
252944
4593