🎨 Fix database table view loading https://ld246.com/article/1697168944677

This commit is contained in:
Daniel 2023-10-13 13:21:53 +08:00
parent 48e871c75e
commit 00ed190ad7
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 8 additions and 0 deletions

View file

@ -520,6 +520,10 @@ func SaveAttributeView(av *AttributeView) (err error) {
// 补全 block 的创建时间和更新时间
for _, v := range kv.Values {
if 0 == v.Block.Created {
if "" == v.Block.ID {
v.Block.ID = ast.NewNodeID()
}
createdStr := v.Block.ID[:len("20060102150405")]
created, parseErr := time.ParseInLocation("20060102150405", createdStr, time.Local)
if nil == parseErr {

View file

@ -190,6 +190,10 @@ func RenderAttributeView(avID string) (viewable av.Viewable, attrView *av.Attrib
case av.KeyTypeBlock: // 补全 block 的创建时间和更新时间
for _, v := range kv.Values {
if 0 == v.Block.Created {
if "" == v.Block.ID {
v.Block.ID = ast.NewNodeID()
}
createdStr := v.Block.ID[:len("20060102150405")]
created, parseErr := time.ParseInLocation("20060102150405", createdStr, time.Local)
if nil == parseErr {