mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 00:38:49 +01:00
🐛 只读模式下多项折叠会导致数据类型错误 https://github.com/siyuan-note/siyuan/issues/6557
This commit is contained in:
parent
459f3e2f04
commit
c9af265903
2 changed files with 51 additions and 32 deletions
|
|
@ -63,22 +63,6 @@ func performTransactions(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
setAttrsOps := model.ExtractSetAttrsOps(&transactions)
|
||||
for _, setAttrsOp := range setAttrsOps {
|
||||
attrs := map[string]string{}
|
||||
if err = gulu.JSON.UnmarshalJSON([]byte(setAttrsOp.Data.(string)), &attrs); nil != err {
|
||||
return
|
||||
}
|
||||
if err = model.SetBlockAttrs(setAttrsOp.ID, attrs); nil != err {
|
||||
if errors.Is(err, filelock.ErrUnableAccessFile) {
|
||||
ret.Code = 1
|
||||
return
|
||||
}
|
||||
logging.LogFatalf("set block attrs failed: %s", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if err = model.PerformTransactions(&transactions); errors.Is(err, filelock.ErrUnableAccessFile) {
|
||||
ret.Code = 1
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue