Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Feb 4, 2024
2 parents 6af6231 + 3dc93ff commit c27b285
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 2 deletions.
3 changes: 3 additions & 0 deletions kernel/api/filetree.go
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,9 @@ func getDocCreateSavePath(c *gin.Context) {
if "../" == docCreateSavePathTpl {
docCreateSavePathTpl = "../Untitled"
}
if "/" == docCreateSavePathTpl {
docCreateSavePathTpl = "/Untitled"
}

p, err := model.RenderGoTemplate(docCreateSavePathTpl)
if nil != err {
Expand Down
3 changes: 3 additions & 0 deletions kernel/api/notebook.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,9 @@ func setNotebookConf(c *gin.Context) {
if "../" == boxConf.DocCreateSavePath {
boxConf.DocCreateSavePath = "../Untitled"
}
if "/" == boxConf.DocCreateSavePath {
boxConf.DocCreateSavePath = "/Untitled"
}

box.SaveConf(boxConf)
ret.Data = boxConf
Expand Down
3 changes: 3 additions & 0 deletions kernel/api/setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,9 @@ func setFiletree(c *gin.Context) {
if "../" == fileTree.DocCreateSavePath {
fileTree.DocCreateSavePath = "../Untitled"
}
if "/" == fileTree.DocCreateSavePath {
fileTree.DocCreateSavePath = "/Untitled"
}

if 1 > fileTree.MaxOpenTabCount {
fileTree.MaxOpenTabCount = 8
Expand Down
16 changes: 14 additions & 2 deletions kernel/av/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package av

import (
"bytes"
"math"
"sort"
"strconv"
Expand Down Expand Up @@ -210,8 +211,19 @@ func (value *Value) Compare(other *Value) int {
}
case KeyTypeRollup:
if nil != value.Rollup && nil != other.Rollup {
vContent := strings.TrimSpace(strings.Join(value.Relation.Contents, " "))
oContent := strings.TrimSpace(strings.Join(other.Relation.Contents, " "))
vContentBuf := bytes.Buffer{}
for _, c := range value.Rollup.Contents {
vContentBuf.WriteString(c.String())
vContentBuf.WriteByte(' ')
}
vContent := strings.TrimSpace(vContentBuf.String())
oContentBuf := bytes.Buffer{}
for _, c := range other.Rollup.Contents {
oContentBuf.WriteString(c.String())
oContentBuf.WriteByte(' ')
}
oContent := strings.TrimSpace(oContentBuf.String())

if util.IsNumeric(vContent) && util.IsNumeric(oContent) {
v1, _ := strconv.ParseFloat(vContent, 64)
v2, _ := strconv.ParseFloat(oContent, 64)
Expand Down
3 changes: 3 additions & 0 deletions kernel/model/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ func InitConf() {
if "../" == Conf.FileTree.DocCreateSavePath {
Conf.FileTree.DocCreateSavePath = "../Untitled"
}
if "/" == Conf.FileTree.DocCreateSavePath {
Conf.FileTree.DocCreateSavePath = "/Untitled"
}
util.UseSingleLineSave = Conf.FileTree.UseSingleLineSave

util.CurrentCloudRegion = Conf.CloudRegion
Expand Down

0 comments on commit c27b285

Please sign in to comment.