mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
🎨 Improve the status bar index creation information prompt https://github.com/siyuan-note/siyuan/issues/15390
This commit is contained in:
parent
16d3b65b2a
commit
55bc708582
2 changed files with 7 additions and 6 deletions
|
@ -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))
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue