Skip to content

Commit c58deb1

Browse files
committed
🏷️(frontend) adapt thread new type
We stopped to use pagination for thread comments, so we need to adapt the thread type to reflect that.
1 parent 9a1dae4 commit c58deb1

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/frontend/apps/e2e/__tests__/app-impress/doc-version.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ test.describe('Doc Version', () => {
142142
const thread = page.locator('.bn-thread');
143143
await thread.getByRole('paragraph').first().fill('This is a comment');
144144
await thread.locator('[data-test="save"]').click();
145+
await expect(thread).toBeHidden();
145146

146147
await goToGridDoc(page, {
147148
title: randomDoc,

src/frontend/apps/impress/src/features/docs/doc-editor/components/comments/DocsThreadStore.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { CommentBody, ThreadStore } from '@blocknote/core/comments';
22
import type { Awareness } from 'y-protocols/awareness';
33

4-
import { APIError, APIList, errorCauses, fetchAPI } from '@/api';
4+
import { APIError, errorCauses, fetchAPI } from '@/api';
55
import { Doc } from '@/features/docs/doc-management';
66

77
import { useEditorStore } from '../../stores';
@@ -15,7 +15,7 @@ import {
1515
ServerThread,
1616
} from './types';
1717

18-
type ServerThreadListResponse = APIList<ServerThread>;
18+
type ServerThreadListResponse = ServerThread[];
1919

2020
export class DocsThreadStore extends ThreadStore {
2121
protected static COMMENTS_PING = 'commentsPing';
@@ -335,7 +335,7 @@ export class DocsThreadStore extends ThreadStore {
335335

336336
const threads = (await response.json()) as ServerThreadListResponse;
337337
const next = new Map<string, ClientThreadData>();
338-
threads.results.forEach((thread) => {
338+
threads.forEach((thread) => {
339339
const threadData: ClientThreadData = serverThreadToClientThread(thread);
340340
next.set(thread.id, threadData);
341341
});

0 commit comments

Comments
 (0)