mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00:00
refactor(editor): add runtime type checks to database cell values (#10770)
This commit is contained in:
@@ -79,11 +79,13 @@ export const database: InitFn = (collection: Workspace, id: string) => {
|
||||
{ type: type, text: new Text(`Paragraph type ${type}`) },
|
||||
databaseId
|
||||
);
|
||||
datasource.cellValueChange(
|
||||
id,
|
||||
richTextId,
|
||||
new Text(`Paragraph type ${type}`)
|
||||
);
|
||||
if (richTextId) {
|
||||
datasource.cellValueChange(
|
||||
id,
|
||||
richTextId,
|
||||
new Text(`Paragraph type ${type}`)
|
||||
);
|
||||
}
|
||||
});
|
||||
const listTypes: ListType[] = ['numbered', 'bulleted', 'todo', 'toggle'];
|
||||
|
||||
@@ -93,11 +95,13 @@ export const database: InitFn = (collection: Workspace, id: string) => {
|
||||
{ type: type, text: new Text(`List type ${type}`) },
|
||||
databaseId
|
||||
);
|
||||
datasource.cellValueChange(
|
||||
id,
|
||||
richTextId,
|
||||
new Text(`List type ${type}`)
|
||||
);
|
||||
if (richTextId) {
|
||||
datasource.cellValueChange(
|
||||
id,
|
||||
richTextId,
|
||||
new Text(`List type ${type}`)
|
||||
);
|
||||
}
|
||||
});
|
||||
// Add a paragraph after database
|
||||
doc.addBlock('affine:paragraph', {}, noteId);
|
||||
|
||||
Reference in New Issue
Block a user