mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
refactor(editor): job should not rely on doc collection directly (#9488)
This commit is contained in:
@@ -4,7 +4,7 @@ import {
|
||||
StdIdentifier,
|
||||
} from '@blocksuite/block-std';
|
||||
import { type Container, createIdentifier } from '@blocksuite/global/di';
|
||||
import { Job, Slice, type SliceSnapshot } from '@blocksuite/store';
|
||||
import { Slice, type SliceSnapshot } from '@blocksuite/store';
|
||||
|
||||
export const DndApiExtensionIdentifier = createIdentifier<DNDAPIExtension>(
|
||||
'AffineDndApiIdentifier'
|
||||
@@ -40,7 +40,7 @@ export class DNDAPIExtension extends Extension {
|
||||
const { docId, flavour = 'affine:embed-linked-doc', blockId } = options;
|
||||
|
||||
const slice = Slice.fromModels(this.std.doc, []);
|
||||
const job = new Job({ collection: this.std.collection });
|
||||
const job = this.std.getJob();
|
||||
const snapshot = job.sliceToSnapshot(slice);
|
||||
if (!snapshot) {
|
||||
console.error('Failed to convert slice to snapshot');
|
||||
|
||||
Reference in New Issue
Block a user