mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
🎨 Fix kanban attrView followup (#16277)
* fix: more robust fix for kanban empty groups error
- followup for handling of edge cases that cause "Cannot read properties of undefined (reading 'forEach')" error in renderKanban
- always apply preferred group key logic whenever kanban has an empty group key
* 🎨 Clean code
---------
Co-authored-by: D <845765@qq.com>
This commit is contained in:
parent
d4c46ebaa2
commit
3525c2b5d9
1 changed files with 9 additions and 1 deletions
|
|
@ -90,7 +90,15 @@ func renderAttributeView(attrView *av.AttributeView, nodeID, viewID, query strin
|
|||
func renderAttributeViewGroups(viewable av.Viewable, attrView *av.AttributeView, view *av.View, query string, page, pageSize int, groupPaging map[string]interface{}) (err error) {
|
||||
groupKey := view.GetGroupKey(attrView)
|
||||
if nil == groupKey {
|
||||
return
|
||||
if view.LayoutType == av.LayoutTypeKanban {
|
||||
preferredGroupKey := getKanbanPreferredGroupKey(attrView)
|
||||
group := &av.ViewGroup{Field: preferredGroupKey.ID}
|
||||
setAttributeViewGroup(attrView, view, group)
|
||||
av.SaveAttributeView(attrView)
|
||||
groupKey = view.GetGroupKey(attrView)
|
||||
} else {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// 当前日期可能会变,所以如果是按日期分组则需要重新生成分组
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue