[WIKI-331] fix: editor ref issues while locking/unlocking page #6965

This commit is contained in:
M. Palanikannan 2025-04-24 17:38:41 +05:30 committed by GitHub
parent b54f54999e
commit 797f150ec4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View file

@ -74,6 +74,12 @@ export const PageRoot = observer((props: TPageRootProps) => {
[page.editorRef, setEditorRef]
);
useEffect(() => {
setTimeout(() => {
setEditorRef(editorRef.current);
}, 0);
}, [isContentEditable, setEditorRef]);
const version = searchParams.get("version");
useEffect(() => {
if (!version) {

View file

@ -250,10 +250,10 @@ export class ProjectPageStore implements IProjectPageStore {
});
const page = await this.service.fetchById(workspaceSlug, projectId, pageId);
const pageInstance = page?.id ? this.getPageById(page.id) : undefined;
runInAction(() => {
if (page?.id) {
const pageInstance = this.getPageById(page.id);
if (pageInstance) {
pageInstance.mutateProperties(page, false);
} else {