mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 17:40:13 +01:00
🎨 Improve av
This commit is contained in:
parent
d77d29cf78
commit
a45b62e76b
2 changed files with 16 additions and 7 deletions
|
|
@ -23,14 +23,23 @@ import (
|
|||
"github.com/siyuan-note/siyuan/kernel/treenode"
|
||||
)
|
||||
|
||||
func checkViewInstance(attrView *av.AttributeView, view *av.View) {
|
||||
if av.LayoutTypeGallery == view.LayoutType && nil == view.Gallery {
|
||||
// 切换为画廊视图时可能没有初始化画廊实例 https://github.com/siyuan-note/siyuan/issues/15122
|
||||
if nil != view.Table {
|
||||
view.LayoutType = av.LayoutTypeTable
|
||||
av.SaveAttributeView(attrView)
|
||||
func checkViewInstance(attrView *av.AttributeView) {
|
||||
changed := false
|
||||
for i, view := range attrView.Views {
|
||||
if av.LayoutTypeGallery == view.LayoutType && nil == view.Gallery {
|
||||
// 切换为画廊视图时可能没有初始化画廊实例 https://github.com/siyuan-note/siyuan/issues/15122
|
||||
if nil != view.Table {
|
||||
view.LayoutType = av.LayoutTypeTable
|
||||
changed = true
|
||||
} else {
|
||||
attrView.Views = append(attrView.Views[:i], attrView.Views[i+1:]...)
|
||||
changed = true
|
||||
}
|
||||
}
|
||||
}
|
||||
if changed {
|
||||
av.SaveAttributeView(attrView)
|
||||
}
|
||||
}
|
||||
|
||||
func upgradeAttributeViewSpec(attrView *av.AttributeView) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue