Skip to content

Commit

Permalink
Fix RO mode
Browse files Browse the repository at this point in the history
  • Loading branch information
zefhemel committed Aug 22, 2024
1 parent 1958739 commit efc5fa6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion web/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,8 @@ export class Client implements ConfigContainer {
});
}).catch(console.error);

if (loadingDifferentPage) {
// When loading a different page OR if the page is read-only (in which case we don't want to apply local patches, because there's no point)
if (loadingDifferentPage || doc.meta.perm === "ro") {
const editorState = createEditorState(
this,
pageName,
Expand All @@ -1145,6 +1146,7 @@ export class Client implements ConfigContainer {
}
this.space.watchPage(pageName);
} else {
// Just apply minimal patches so that the cursor is preserved
await editor.setText(doc.text);
}

Expand Down

0 comments on commit efc5fa6

Please sign in to comment.