🎨 Improve the status bar index creation information prompt https://github.com/siyuan-note/siyuan/issues/15390

This commit is contained in:
Daniel 2025-08-01 16:01:32 +08:00
parent 16d3b65b2a
commit 55bc708582
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 7 additions and 6 deletions

View file

@ -677,10 +677,10 @@ func FullReindex() {
}
func fullReindex() {
pushSQLInsertBlocksFTSMsg = true
pushSQLInsertBlocksFTSMsg, pushSQLDeleteBlocksMsg = true, true
defer func() {
sql.FlushQueue()
pushSQLInsertBlocksFTSMsg = false
pushSQLInsertBlocksFTSMsg, pushSQLDeleteBlocksMsg = false, false
}()
util.PushEndlessProgress(Conf.language(35))

View file

@ -359,7 +359,10 @@ func init() {
subscribeSQLEvents()
}
var pushSQLInsertBlocksFTSMsg bool
var (
pushSQLInsertBlocksFTSMsg bool
pushSQLDeleteBlocksMsg bool
)
func subscribeSQLEvents() {
// 使用下面的 EvtSQLInsertBlocksFTS 就可以了
@ -371,8 +374,6 @@ func subscribeSQLEvents() {
//})
eventbus.Subscribe(eventbus.EvtSQLInsertBlocksFTS, func(context map[string]interface{}, blockCount int, hash string) {
if !pushSQLInsertBlocksFTSMsg {
// 如果不是全量重建索引,则不显示进度信息
// Improve status bar index creation information prompt https://github.com/siyuan-note/siyuan/issues/15390
return
}
@ -383,7 +384,7 @@ func subscribeSQLEvents() {
util.ContextPushMsg(context, msg)
})
eventbus.Subscribe(eventbus.EvtSQLDeleteBlocks, func(context map[string]interface{}, rootID string) {
if util.ContainerAndroid == util.Container || util.ContainerIOS == util.Container || util.ContainerHarmony == util.Container {
if !pushSQLDeleteBlocksMsg {
return
}