mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-13 10:44:20 +01:00
🐛 只读模式下多项折叠会导致数据类型错误 https://github.com/siyuan-note/siyuan/issues/6557
This commit is contained in:
parent
86804f1c1d
commit
6d8d730262
2 changed files with 24 additions and 11 deletions
|
|
@ -56,13 +56,20 @@ func IsUnfoldHeading(transactions *[]*Transaction) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
func IsSetAttrs(transactions *[]*Transaction) *Operation {
|
||||
if 1 == len(*transactions) && 1 == len((*transactions)[0].DoOperations) {
|
||||
if op := (*transactions)[0].DoOperations[0]; "setAttrs" == op.Action {
|
||||
return op
|
||||
func ExtractSetAttrsOps(transactions *[]*Transaction) (ret []*Operation) {
|
||||
for _, tx := range *transactions {
|
||||
var setAttrsOps, tmp []*Operation
|
||||
for _, op := range tx.DoOperations {
|
||||
if "setAttrs" == op.Action {
|
||||
setAttrsOps = append(setAttrsOps, op)
|
||||
} else {
|
||||
tmp = append(tmp, op)
|
||||
}
|
||||
}
|
||||
ret = append(ret, setAttrsOps...)
|
||||
tx.DoOperations = tmp
|
||||
}
|
||||
return nil
|
||||
return
|
||||
}
|
||||
|
||||
const txFixDelay = 10
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue