Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
e006713e7c
2 changed files with 1 additions and 5 deletions
|
@ -49,7 +49,7 @@ func WaitForUILoaded() {
|
|||
for !IsUILoaded {
|
||||
time.Sleep(200 * time.Millisecond)
|
||||
if time.Since(start) > 30*time.Second {
|
||||
logging.LogErrorf("wait for ui loaded timeout")
|
||||
logging.LogErrorf("wait for ui loaded timeout: %s", logging.ShortStack())
|
||||
break
|
||||
}
|
||||
}
|
||||
|
|
|
@ -153,27 +153,23 @@ 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
Reference in a new issue