mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
fix(editor): edgeless selected block is missing in the return of getSelectedBlockCommand (#11813)
This commit is contained in:
@@ -65,7 +65,7 @@ export class PageClipboard extends ReadOnlyClipboard {
|
||||
const e = ctx.get('clipboardState').raw;
|
||||
e.preventDefault();
|
||||
|
||||
this._copySelected(() => {
|
||||
this._copySelectedInPage(() => {
|
||||
this.std.command
|
||||
.chain()
|
||||
.try<{}>(cmd => [
|
||||
|
||||
@@ -84,11 +84,11 @@ export const clipboardConfigs: ExtensionType[] = [
|
||||
export class ReadOnlyClipboard extends LifeCycleWatcher {
|
||||
static override key = 'affine-readonly-clipboard';
|
||||
|
||||
protected readonly _copySelected = (onCopy?: () => void) => {
|
||||
protected readonly _copySelectedInPage = (onCopy?: () => void) => {
|
||||
return this.std.command
|
||||
.chain()
|
||||
.with({ onCopy })
|
||||
.pipe(getSelectedModelsCommand)
|
||||
.pipe(getSelectedModelsCommand, { types: ['block', 'text', 'image'] })
|
||||
.pipe(draftSelectedModelsCommand)
|
||||
.pipe(copySelectedModelsCommand);
|
||||
};
|
||||
@@ -118,7 +118,7 @@ export class ReadOnlyClipboard extends LifeCycleWatcher {
|
||||
const e = ctx.get('clipboardState').raw;
|
||||
e.preventDefault();
|
||||
|
||||
this._copySelected().run();
|
||||
this._copySelectedInPage().run();
|
||||
};
|
||||
|
||||
override mounted(): void {
|
||||
|
||||
Reference in New Issue
Block a user