mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
Fix issue [BS-1779](https://linear.app/affine-design/issue/BS-1779). The attribute `contenteditable` will be `true` if the document is not read-only. In this case, the note preview can be focused on and users can edit the note content. But we can not simply make the document read-only. If the user changes the editor settings, we also need to update the document model, which requires that the document is not read-only. Thus following code sets the document editable before the model updates and resets the document to read-only after the model is updated.