use `match` in handle-webview-properties

phoen
Daniel Barlow 2022-02-06 14:15:59 +00:00
parent 1cd2247e02
commit 35e2d56af7
1 changed files with 11 additions and 17 deletions

View File

@ -73,26 +73,20 @@ progress, trough {
(fn handle-webview-properties [self pspec bus]
(if (= pspec.name "uri")
(bus:publish
:url-changed self.uri)
(match pspec.name
"uri"
(bus:publish :url-changed self.uri)
(and (= pspec.name "title")
(> (# self.title) 0))
(bus:publish
:title-changed
self.title)
"title"
(if (> (self.title:len) 0)
(bus:publish :title-changed self.title))
(= pspec.name
"estimated-load-progress")
(bus:publish
:loading-progress
self.estimated_load_progress)
"estimated-load-progress"
(bus:publish :loading-progress self.estimated_load_progress)
(= pspec.name "is-loading")
(bus:publish
:loading? self.is_loading)
))
"is-loading"
(bus:publish :loading? self.is_loading)
))
(let [current-url "https://terse.telent.net/admin/stream"
bus (event-bus)