🏷️(frontend) adapt thread new type

We stopped to use pagination for thread comments,
so we need to adapt the thread type to reflect that.
This commit is contained in:
Anthony LC 2026-04-08 14:04:03 +02:00
parent 9a1dae4908
commit c58deb11e8
No known key found for this signature in database
2 changed files with 4 additions and 3 deletions

View file

@ -142,6 +142,7 @@ test.describe('Doc Version', () => {
const thread = page.locator('.bn-thread');
await thread.getByRole('paragraph').first().fill('This is a comment');
await thread.locator('[data-test="save"]').click();
await expect(thread).toBeHidden();
await goToGridDoc(page, {
title: randomDoc,

View file

@ -1,7 +1,7 @@
import { CommentBody, ThreadStore } from '@blocknote/core/comments';
import type { Awareness } from 'y-protocols/awareness';
import { APIError, APIList, errorCauses, fetchAPI } from '@/api';
import { APIError, errorCauses, fetchAPI } from '@/api';
import { Doc } from '@/features/docs/doc-management';
import { useEditorStore } from '../../stores';
@ -15,7 +15,7 @@ import {
ServerThread,
} from './types';
type ServerThreadListResponse = APIList<ServerThread>;
type ServerThreadListResponse = ServerThread[];
export class DocsThreadStore extends ThreadStore {
protected static COMMENTS_PING = 'commentsPing';
@ -335,7 +335,7 @@ export class DocsThreadStore extends ThreadStore {
const threads = (await response.json()) as ServerThreadListResponse;
const next = new Map<string, ClientThreadData>();
threads.results.forEach((thread) => {
threads.forEach((thread) => {
const threadData: ClientThreadData = serverThreadToClientThread(thread);
next.set(thread.id, threadData);
});