mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
♻️ Implement some delayed kernel events using task queues https://github.com/siyuan-note/siyuan/issues/12393
This commit is contained in:
parent
9088e49a76
commit
09eec52a02
10 changed files with 79 additions and 44 deletions
|
|
@ -153,23 +153,27 @@ func PushTxErr(msg string, code int, data interface{}) {
|
|||
}
|
||||
|
||||
func PushUpdateMsg(msgId string, msg string, timeout int) {
|
||||
WaitForUILoaded()
|
||||
BroadcastByType("main", "msg", 0, msg, map[string]interface{}{"id": msgId, "closeTimeout": timeout})
|
||||
return
|
||||
}
|
||||
|
||||
func PushMsg(msg string, timeout int) (msgId string) {
|
||||
WaitForUILoaded()
|
||||
msgId = gulu.Rand.String(7)
|
||||
BroadcastByType("main", "msg", 0, msg, map[string]interface{}{"id": msgId, "closeTimeout": timeout})
|
||||
return
|
||||
}
|
||||
|
||||
func PushErrMsg(msg string, timeout int) (msgId string) {
|
||||
WaitForUILoaded()
|
||||
msgId = gulu.Rand.String(7)
|
||||
BroadcastByType("main", "msg", -1, msg, map[string]interface{}{"id": msgId, "closeTimeout": timeout})
|
||||
return
|
||||
}
|
||||
|
||||
func PushStatusBar(msg string) {
|
||||
WaitForUILoaded()
|
||||
msg += " (" + time.Now().Format("2006-01-02 15:04:05") + ")"
|
||||
BroadcastByType("main", "statusbar", 0, msg, nil)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue