From 306cf2ae6ff5f83958fb58d8a56451987e3ab65c Mon Sep 17 00:00:00 2001 From: EYHN Date: Mon, 27 May 2024 07:51:59 +0000 Subject: [PATCH] fix(core): unexpected re-render in edgeless (#7077) --- .../block-suite-editor/blocksuite-editor-container.tsx | 8 ++++++-- packages/frontend/graphql/src/schema.ts | 6 ++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/frontend/core/src/components/blocksuite/block-suite-editor/blocksuite-editor-container.tsx b/packages/frontend/core/src/components/blocksuite/block-suite-editor/blocksuite-editor-container.tsx index d1d4131608..b72f7366e8 100644 --- a/packages/frontend/core/src/components/blocksuite/block-suite-editor/blocksuite-editor-container.tsx +++ b/packages/frontend/core/src/components/blocksuite/block-suite-editor/blocksuite-editor-container.tsx @@ -259,7 +259,11 @@ export const BlocksuiteEditorContainer = forwardRef< return; } if (selection[0]?.type !== 'block') { - return currentView.history.replace(currentPath); + if (locationHash) { + // Clear the hash if no block is selected + currentView.replace(currentPath); + } + return; } const selectedId = selection[0]?.blockId; @@ -270,7 +274,7 @@ export const BlocksuiteEditorContainer = forwardRef< // Only update the hash if it has changed if (locationHash !== newHash) { - currentView.history.replace(currentPath + newHash); + currentView.replace(currentPath + newHash); } }; affineEditorContainerProxy.updateComplete diff --git a/packages/frontend/graphql/src/schema.ts b/packages/frontend/graphql/src/schema.ts index dce2789564..8ca451e558 100644 --- a/packages/frontend/graphql/src/schema.ts +++ b/packages/frontend/graphql/src/schema.ts @@ -59,6 +59,12 @@ export interface CreateCheckoutSessionInput { successCallbackLink: InputMaybe; } +export interface DeleteSessionInput { + docId: Scalars['String']['input']; + sessionIds: Array; + workspaceId: Scalars['String']['input']; +} + export enum EarlyAccessType { AI = 'AI', App = 'App',