Skip to content

Commit 6e3dd43

Browse files
committed
fix: guard from parent id
1 parent 78fa341 commit 6e3dd43

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

package/src/components/ChannelPreview/hooks/useChannelPreviewData.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const useChannelPreviewData = (
2929
useEffect(() => {
3030
const { unsubscribe } = client.on('draft.updated', (event) => {
3131
const { cid, draft } = event;
32-
if (!draft || cid !== channel.cid) {
32+
if (!draft || cid !== channel.cid || draft.parent_id) {
3333
return;
3434
}
3535
channel.messageComposer.initState({ composition: draft });
@@ -40,7 +40,7 @@ export const useChannelPreviewData = (
4040
useEffect(() => {
4141
const { unsubscribe } = client.on('draft.deleted', (event) => {
4242
const { cid, draft } = event;
43-
if (!draft || cid !== channel.cid) {
43+
if (!draft || cid !== channel.cid || draft.parent_id) {
4444
return;
4545
}
4646

0 commit comments

Comments
 (0)