use match in handle-webview-properties

This commit is contained in:
Daniel Barlow 2022-02-06 14:15:59 +00:00
parent 1cd2247e02
commit 35e2d56af7

View File

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