Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

chore: remove property correct

lawvs29d5a8c9710b
diff --git a/libs/components/editor-core/src/recast-block/property.ts b/libs/components/editor-core/src/recast-block/property.ts
index c830c5e30b..e8f0104269 100644
--- a/libs/components/editor-core/src/recast-block/property.ts
+++ b/libs/components/editor-core/src/recast-block/property.ts
@@ -248,10 +248,8 @@ export const getRecastItemValue = (block: RecastItem | AsyncBlock) => {
};
const removeValue = (propertyId: RecastPropertyId) => {
- return recastItem.setProperty(TABLE_VALUES_KEY, {
- ...props,
- [propertyId]: null,
- });
+ const { [propertyId]: omitted, ...restProps } = props;
+ return recastItem.setProperty(TABLE_VALUES_KEY, restProps);
};
return { getAllValue, getValue, setValue, removeValue };
};
diff --git a/libs/components/editor-core/src/recast-block/types/index.ts b/libs/components/editor-core/src/recast-block/types/index.ts
index e1a097ebe6..e7e44d347d 100644
--- a/libs/components/editor-core/src/recast-block/types/index.ts
+++ b/libs/components/editor-core/src/recast-block/types/index.ts
@@ -18,6 +18,7 @@ type VariantBlock<Props> = Omit<
value: Props[T]
): Promise<boolean>;
setProperties(value: Partial<Props>): Promise<boolean>;
+ removeProperty<T extends keyof Props>(key: T): Promise<boolean>;
};
export type RecastBlock = VariantBlock<RecastDataProperties>;