mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-16 22:07:09 +08:00
refactor(core): move block collection to affine and implement as doc (#9514)
This commit is contained in:
@@ -19,7 +19,7 @@ export function addProperty(
|
||||
id?: string;
|
||||
}
|
||||
): string {
|
||||
const id = column.id ?? model.doc.generateBlockId();
|
||||
const id = column.id ?? model.doc.collection.idGenerator();
|
||||
if (model.columns.some(v => v.id === id)) {
|
||||
return id;
|
||||
}
|
||||
@@ -101,7 +101,7 @@ export function deleteView(model: DatabaseBlockModel, id: string) {
|
||||
}
|
||||
|
||||
export function duplicateView(model: DatabaseBlockModel, id: string): string {
|
||||
const newId = model.doc.generateBlockId();
|
||||
const newId = model.doc.collection.idGenerator();
|
||||
model.doc.transact(() => {
|
||||
const index = model.views.findIndex(v => v.id === id);
|
||||
const view = model.views[index];
|
||||
|
||||
Reference in New Issue
Block a user