Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2024-04-14 08:46:53 +08:00
commit b77d27b91a
2 changed files with 10 additions and 4 deletions

View file

@ -233,8 +233,8 @@ func (value *Value) Compare(other *Value, attrView *AttributeView) int {
}
oContent := strings.TrimSpace(oContentBuf.String())
v1, ok1 := util.Convert2Float(value.Template.Content)
v2, ok2 := util.Convert2Float(other.Template.Content)
v1, ok1 := util.Convert2Float(vContent)
v2, ok2 := util.Convert2Float(oContent)
if ok1 && ok2 {
if v1 > v2 {
return 1
@ -262,8 +262,8 @@ func (value *Value) Compare(other *Value, attrView *AttributeView) int {
}
oContent := strings.TrimSpace(oContentBuf.String())
v1, ok1 := util.Convert2Float(value.Template.Content)
v2, ok2 := util.Convert2Float(other.Template.Content)
v1, ok1 := util.Convert2Float(vContent)
v2, ok2 := util.Convert2Float(oContent)
if ok1 && ok2 {
if v1 > v2 {
return 1

View file

@ -3003,6 +3003,12 @@ func UpdateAttributeViewCell(tx *Transaction, avID, keyID, rowID, cellID string,
return
}
if "" == val.ID {
// 有时前端会误调用该接口(比如创建完快速切换),这里判断一下,避免误更新刚刚创建的值
// Primary key value unexpectedly updated when database adds row https://github.com/siyuan-note/siyuan/issues/11018
return
}
if av.KeyTypeNumber == val.Type {
if nil != val.Number && !val.Number.IsNotEmpty {
val.Number.Content = 0