Skip to content

Commit eaf9e53

Browse files
author
Fred Wu
committed
fix multiple request
1 parent d56ad46 commit eaf9e53

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/session.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ export async function showDataView(source: string, type: string, title: string,
410410
}
411411

412412
// Register the message handler after panel is created or retrieved, but only once per panel
413-
if (panel) {
413+
if (panel && !(panel as any)._hasFetchHandler) {
414414
panel.webview.onDidReceiveMessage(async (message: WebviewMessage & {
415415
requestId?: string;
416416
sortModel?: Array<{ colId: string; sort: 'asc' | 'desc' }>;
@@ -477,6 +477,7 @@ export async function showDataView(source: string, type: string, title: string,
477477
}
478478
}
479479
});
480+
(panel as any)._hasFetchHandler = true;
480481
}
481482

482483
if (panel) {
@@ -746,7 +747,7 @@ export async function getTableHtml(webview: Webview, file: string): Promise<stri
746747
rowModelType: 'infinite',
747748
cacheBlockSize: 100,
748749
maxBlocksInCache: 20,
749-
infiniteInitialRowCount: 0,
750+
infiniteInitialRowCount: 100,
750751
rowBuffer: 5,
751752
blockLoadDebounceMillis: 300,
752753

0 commit comments

Comments
 (0)