Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(editor): clicking footnote node should not open doc when readonly (#11749)

donteatfriedriced6287fd7b015
diff --git a/blocksuite/affine/inlines/footnote/src/footnote-node/footnote-node.ts b/blocksuite/affine/inlines/footnote/src/footnote-node/footnote-node.ts
index 103eab3c48..5e1b02fe3a 100644
--- a/blocksuite/affine/inlines/footnote/src/footnote-node/footnote-node.ts
+++ b/blocksuite/affine/inlines/footnote/src/footnote-node/footnote-node.ts
@@ -110,6 +110,10 @@ export class AffineFootnoteNode extends WithDisposable(ShadowlessElement) {
return this.delta.attributes?.footnote;
}
+ get readonly() {
+ return this.std.store.readonly;
+ }
+
onFootnoteClick = () => {
if (!this.footnote) {
return;
@@ -131,6 +135,10 @@ export class AffineFootnoteNode extends WithDisposable(ShadowlessElement) {
};
private readonly _handleDocReference = (docId: string) => {
+ if (this.readonly) {
+ return;
+ }
+
this.std
.getOptional(PeekViewProvider)
?.peek({