@ai-matrx/messaging 0.10.4 → 0.10.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/index.cjs +4 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +4 -2
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +4 -2
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
package/dist/react.cjs
CHANGED
|
@@ -1208,7 +1208,9 @@ function createMessagingEngine(options) {
|
|
|
1208
1208
|
openChannels.get(message.conversationId)?.send(MESSAGING_EVENTS.message, message);
|
|
1209
1209
|
}
|
|
1210
1210
|
async function reloadInbox() {
|
|
1211
|
+
if (disposed) return;
|
|
1211
1212
|
const page = await repository.listConversations({ limit: conversationPageSize });
|
|
1213
|
+
if (disposed) return;
|
|
1212
1214
|
conversationCursor = page.nextCursor;
|
|
1213
1215
|
store.setConversations(page.items, page.hasMore);
|
|
1214
1216
|
}
|
|
@@ -1253,7 +1255,7 @@ function createMessagingEngine(options) {
|
|
|
1253
1255
|
const message = projectMessage(row, identity.organizationId);
|
|
1254
1256
|
const known = store.snapshot().conversations.some((item) => item.conversation.id === message.conversationId);
|
|
1255
1257
|
if (!known) {
|
|
1256
|
-
void reloadInbox();
|
|
1258
|
+
void reloadInbox().catch((error) => reportError(error, "inboxRefresh"));
|
|
1257
1259
|
return;
|
|
1258
1260
|
}
|
|
1259
1261
|
store.ingest(message);
|
|
@@ -1269,7 +1271,7 @@ function createMessagingEngine(options) {
|
|
|
1269
1271
|
filter: `user_id=eq.${identity.userId}`,
|
|
1270
1272
|
rowId: (row) => typeof row["id"] === "string" ? row["id"] : void 0,
|
|
1271
1273
|
onChange: () => {
|
|
1272
|
-
void reloadInbox();
|
|
1274
|
+
void reloadInbox().catch((error) => reportError(error, "inboxRefresh"));
|
|
1273
1275
|
}
|
|
1274
1276
|
}
|
|
1275
1277
|
],
|