@noverachat/sdk-react 0.5.0 → 0.5.2
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/dist/index.cjs +1 -0
- package/dist/index.js +1 -0
- package/package.json +2 -2
- package/src/room-list-store.ts +3 -0
package/dist/index.cjs
CHANGED
|
@@ -353,6 +353,7 @@ var RoomListStore = class {
|
|
|
353
353
|
const i = this.index.get(roomId);
|
|
354
354
|
if (i === void 0) return;
|
|
355
355
|
const cur = this.rooms[i];
|
|
356
|
+
if (cur.lastMessageId === m.message_id) return;
|
|
356
357
|
const visible = this.opts.isRoomVisible?.(roomId) ?? false;
|
|
357
358
|
const preview = this.opts.previewBuilder?.(m) ?? m.content ?? (m.file_id || m.file || m.files && m.files.length > 0 ? "\u{1F4CE}" : "");
|
|
358
359
|
const updated = {
|
package/dist/index.js
CHANGED
|
@@ -322,6 +322,7 @@ var RoomListStore = class {
|
|
|
322
322
|
const i = this.index.get(roomId);
|
|
323
323
|
if (i === void 0) return;
|
|
324
324
|
const cur = this.rooms[i];
|
|
325
|
+
if (cur.lastMessageId === m.message_id) return;
|
|
325
326
|
const visible = this.opts.isRoomVisible?.(roomId) ?? false;
|
|
326
327
|
const preview = this.opts.previewBuilder?.(m) ?? m.content ?? (m.file_id || m.file || m.files && m.files.length > 0 ? "\u{1F4CE}" : "");
|
|
327
328
|
const updated = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noverachat/sdk-react",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "React hooks/bindings for NoveraChat — @noverachat/sdk-web 위에 얹는 얇은 래퍼",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"react": ">=18"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@noverachat/sdk-web": "0.5.
|
|
27
|
+
"@noverachat/sdk-web": "0.5.2"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/react": "^19.0.0",
|
package/src/room-list-store.ts
CHANGED
|
@@ -198,6 +198,9 @@ export class RoomListStore {
|
|
|
198
198
|
const i = this.index.get(roomId);
|
|
199
199
|
if (i === undefined) return;
|
|
200
200
|
const cur = this.rooms[i]!;
|
|
201
|
+
// 같은 메시지를 두 번 세지 않는다 — 재연결 backfill 은 앵커 이후를 다시
|
|
202
|
+
// `chat_receive` 로 흘려보내므로, 가드가 없으면 안읽음이 부풀어 오른다.
|
|
203
|
+
if (cur.lastMessageId === m.message_id) return;
|
|
201
204
|
const visible = this.opts.isRoomVisible?.(roomId) ?? false;
|
|
202
205
|
const preview =
|
|
203
206
|
this.opts.previewBuilder?.(m) ??
|