mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
🎨 Improve status bar index creation information prompt https://github.com/siyuan-note/siyuan/issues/15390
This commit is contained in:
parent
b358d4b70f
commit
2f57e57b92
3 changed files with 14 additions and 8 deletions
|
|
@ -676,7 +676,14 @@ func FullReindex() {
|
|||
task.AppendTask(task.ReloadUI, util.ReloadUI)
|
||||
}
|
||||
|
||||
var fullReindexing bool
|
||||
|
||||
func fullReindex() {
|
||||
fullReindexing = true
|
||||
defer func() {
|
||||
fullReindexing = false
|
||||
}()
|
||||
|
||||
util.PushEndlessProgress(Conf.language(35))
|
||||
defer util.PushClearProgress()
|
||||
|
||||
|
|
|
|||
|
|
@ -368,6 +368,12 @@ func subscribeSQLEvents() {
|
|||
// util.ContextPushMsg(context, msg)
|
||||
//})
|
||||
eventbus.Subscribe(eventbus.EvtSQLInsertBlocksFTS, func(context map[string]interface{}, blockCount int, hash string) {
|
||||
if !fullReindexing {
|
||||
// 如果不是全量重建索引,则不显示进度信息
|
||||
// Improve status bar index creation information prompt https://github.com/siyuan-note/siyuan/issues/15390
|
||||
return
|
||||
}
|
||||
|
||||
current := context["current"].(int)
|
||||
total := context["total"]
|
||||
msg := fmt.Sprintf(Conf.Language(90), current, total, blockCount, hash)
|
||||
|
|
|
|||
|
|
@ -54,7 +54,6 @@ import (
|
|||
"github.com/siyuan-note/logging"
|
||||
"github.com/siyuan-note/siyuan/kernel/conf"
|
||||
"github.com/siyuan-note/siyuan/kernel/filesys"
|
||||
"github.com/siyuan-note/siyuan/kernel/sql"
|
||||
"github.com/siyuan-note/siyuan/kernel/task"
|
||||
"github.com/siyuan-note/siyuan/kernel/treenode"
|
||||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
|
|
@ -772,13 +771,7 @@ func checkoutRepo(id string) {
|
|||
return
|
||||
}
|
||||
|
||||
task.AppendTask(task.DatabaseIndexFull, fullReindex)
|
||||
task.AppendTask(task.DatabaseIndexRef, IndexRefs)
|
||||
go func() {
|
||||
sql.FlushQueue()
|
||||
ResetVirtualBlockRefCache()
|
||||
}()
|
||||
task.AppendTask(task.ReloadUI, util.ReloadUIResetScroll)
|
||||
FullReindex()
|
||||
|
||||
if syncEnabled {
|
||||
task.AppendAsyncTaskWithDelay(task.PushMsg, 7*time.Second, util.PushMsg, Conf.Language(134), 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue