🎨 Keep the width when duplicating database table view field https://github.com/siyuan-note/siyuan/issues/11552

This commit is contained in:
Daniel 2024-06-10 16:53:43 +08:00
parent cb41abb7bd
commit 22c94e9a68
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -59,7 +59,18 @@ func RenderAttributeViewTable(attrView *av.AttributeView, view *av.View, query s
for _, col := range view.Table.Columns {
key, getErr := attrView.GetKey(col.ID)
if nil != getErr {
switch view.LayoutType {
case av.LayoutTypeTable:
for i, column := range view.Table.Columns {
if column.ID == col.ID {
view.Table.Columns = append(view.Table.Columns[:i], view.Table.Columns[i+1:]...)
break
}
}
}
logging.LogWarnf("get key [%s] failed: %s", col.ID, getErr)
av.SaveAttributeView(attrView)
continue
}