Skip to content

Commit 48c9804

Browse files
committed
1. added timer
1 parent c8ecff8 commit 48c9804

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

contrib/ui/mesh-ui/webview.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import (
1919
)
2020

2121
func main() {
22-
peersTimer := time.NewTimer(time.Minute)
2322
debug := true
2423
w := webview.New(debug)
2524
defer w.Destroy()
@@ -71,10 +70,6 @@ func main() {
7170
w.Bind("onLoad", func() {
7271
log.Println("page loaded")
7372
go run(w)
74-
go func() {
75-
<-peersTimer.C
76-
run(w)
77-
}()
7873
})
7974
w.Bind("savePeers", func(peer_list string) {
8075
//log.Println("peers saved ", peer_list)
@@ -137,11 +132,15 @@ func get_ctl_path() string{
137132
}
138133

139134
func run(w webview.WebView){
135+
//var peersTimer *time.Timer
140136
riv_ctrl_path := get_ctl_path()
141137
if riv_ctrl_path != "" {
142138
get_self(w, riv_ctrl_path)
143139
get_peers(w, riv_ctrl_path)
144140
}
141+
_ = time.AfterFunc(10*time.Second, func() {
142+
run(w)
143+
})
145144
}
146145

147146
func run_command(riv_ctrl_path string, command string) []byte{

0 commit comments

Comments
 (0)