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

This commit is contained in:
donteatfriedrice
2025-04-17 08:52:17 +00:00
parent fa28554b66
commit d6287fd7b0

View File

@@ -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({