♻️ Implement some delayed kernel events using task queues https://github.com/siyuan-note/siyuan/issues/12393

This commit is contained in:
Daniel 2024-09-05 18:07:04 +08:00
parent 9088e49a76
commit 09eec52a02
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
10 changed files with 79 additions and 44 deletions

View file

@ -477,7 +477,7 @@ func ResetRepo() (err error) {
Conf.Save()
util.PushUpdateMsg(msgId, Conf.Language(145), 3000)
task.AppendTaskWithDelay(task.ReloadUI, 2*time.Second, util.ReloadUI)
task.AppendAsyncTaskWithDelay(task.ReloadUI, 2*time.Second, util.ReloadUI)
return
}
@ -656,10 +656,7 @@ func checkoutRepo(id string) {
task.AppendTask(task.ReloadUI, util.ReloadUIResetScroll)
if syncEnabled {
func() {
time.Sleep(5 * time.Second)
util.PushMsg(Conf.Language(134), 0)
}()
task.AppendAsyncTaskWithDelay(task.PushMsg, 3*time.Second, util.PushMsg, Conf.Language(134), 0)
}
return
}