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.

refactor: improves readability

QiShaoXuanc347878f237e
diff --git a/libs/components/editor-core/src/kanban/atom.ts b/libs/components/editor-core/src/kanban/atom.ts
index cc69aff7e8..1a2db8ea90 100644
--- a/libs/components/editor-core/src/kanban/atom.ts
+++ b/libs/components/editor-core/src/kanban/atom.ts
@@ -57,15 +57,15 @@ const isValueBelongOption = (
option: KanbanGroup
) => {
switch (propertyValue.type) {
- case PropertyType.Select: {
+ case PropertyType.Select || PropertyType.Status: {
return propertyValue.value === option.id;
}
case PropertyType.MultiSelect: {
return propertyValue.value.some(i => i === option.id);
}
- case PropertyType.Status: {
- return propertyValue.value === option.id;
- }
+ // case PropertyType.Status: {
+ // return propertyValue.value === option.id;
+ // }
// case PropertyType.Text: {
// TOTODO:DO support this type
// }
diff --git a/libs/components/editor-core/src/recast-block/property.ts b/libs/components/editor-core/src/recast-block/property.ts
index 7d63eeff4c..e6a5caa6de 100644
--- a/libs/components/editor-core/src/recast-block/property.ts
+++ b/libs/components/editor-core/src/recast-block/property.ts
@@ -276,12 +276,12 @@ export const getRecastItemValue = (block: RecastItem | AsyncBlock) => {
const isSelectLikeProperty = (
metaProperty?: RecastMetaProperty
-): metaProperty is SelectProperty | MultiSelectProperty => {
- return !(
- !metaProperty ||
- (metaProperty.type !== PropertyType.Status &&
- metaProperty.type !== PropertyType.Select &&
- metaProperty.type !== PropertyType.MultiSelect)
+): metaProperty is SelectProperty | MultiSelectProperty | StatusProperty => {
+ return (
+ metaProperty &&
+ (metaProperty.type === PropertyType.Status ||
+ metaProperty.type === PropertyType.Select ||
+ metaProperty.type === PropertyType.MultiSelect)
);
};