mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 00:50:13 +01:00
🎨 Display data sync progress in the status bar https://github.com/siyuan-note/siyuan/issues/8552
This commit is contained in:
parent
7f9d6ecd29
commit
52e8834da0
6 changed files with 10 additions and 12 deletions
|
|
@ -1505,19 +1505,17 @@ func subscribeRepoEvents() {
|
|||
util.ContextPushMsg(context, msg)
|
||||
}
|
||||
})
|
||||
eventbus.Subscribe(eventbus.EvtIndexUpsertFiles, func(context map[string]interface{}, files []*entity.File) {
|
||||
msg := fmt.Sprintf(Conf.Language(160), len(files))
|
||||
eventbus.Subscribe(eventbus.EvtIndexUpsertFiles, func(context map[string]interface{}, total int) {
|
||||
msg := fmt.Sprintf(Conf.Language(160), 0, total)
|
||||
util.SetBootDetails(msg)
|
||||
util.ContextPushMsg(context, msg)
|
||||
})
|
||||
indexUpsertFileCount := 0
|
||||
eventbus.Subscribe(eventbus.EvtIndexUpsertFile, func(context map[string]interface{}, path string) {
|
||||
msg := fmt.Sprintf(Conf.Language(160), filepath.Base(path))
|
||||
if 0 == indexUpsertFileCount%64 {
|
||||
eventbus.Subscribe(eventbus.EvtIndexUpsertFile, func(context map[string]interface{}, count int, total int) {
|
||||
msg := fmt.Sprintf(Conf.Language(160), count, total)
|
||||
if 0 == count%64 {
|
||||
util.SetBootDetails(msg)
|
||||
util.ContextPushMsg(context, msg)
|
||||
}
|
||||
indexUpsertFileCount++
|
||||
})
|
||||
|
||||
eventbus.Subscribe(eventbus.EvtCheckoutBeforeWalkData, func(context map[string]interface{}, path string) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue