mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
fix: ai button should not display in readonly mode (#7415)
[BS-737](https://linear.app/affine-design/issue/BS-737/shared-page-也可以用-ai)
This commit is contained in:
@@ -33,7 +33,7 @@ export function setupCodeToolbarEntry(codeToolbar: AffineCodeToolbarWidget) {
|
|||||||
name: 'Ask AI',
|
name: 'Ask AI',
|
||||||
tooltip: 'Ask AI',
|
tooltip: 'Ask AI',
|
||||||
icon: AIStarIcon,
|
icon: AIStarIcon,
|
||||||
showWhen: () => true,
|
showWhen: CodeBlockComponent => !CodeBlockComponent.doc.readonly,
|
||||||
render(codeBlock: CodeBlockComponent, onClick?: () => void) {
|
render(codeBlock: CodeBlockComponent, onClick?: () => void) {
|
||||||
return html`<ask-ai-button
|
return html`<ask-ai-button
|
||||||
class="code-toolbar-button ask-ai"
|
class="code-toolbar-button ask-ai"
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ export function setupImageToolbarEntry(imageToolbar: AffineImageToolbarWidget) {
|
|||||||
}}
|
}}
|
||||||
></ask-ai-button>`;
|
></ask-ai-button>`;
|
||||||
},
|
},
|
||||||
showWhen: () => true,
|
showWhen: imageBlockComponent => !imageBlockComponent.doc.readonly,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
0
|
0
|
||||||
|
|||||||
Reference in New Issue
Block a user