commit 35e2d56af719139bcdd4c3ab246160596693cb95 parent 1cd2247e029cff250f6ff49c6e7625fe8536d8d0 Author: Daniel Barlow <dan@telent.net> Date: Sun, 6 Feb 2022 14:15:59 +0000 use `match` in handle-webview-properties Diffstat:
| M | just/just.fnl | | | 34 | ++++++++++++++-------------------- |
1 file changed, 14 insertions(+), 20 deletions(-)
diff --git a/just/just.fnl b/just/just.fnl @@ -73,26 +73,20 @@ progress, trough { (fn handle-webview-properties [self pspec bus] - (if (= pspec.name "uri") - (bus:publish - :url-changed self.uri) - - (and (= pspec.name "title") - (> (# self.title) 0)) - (bus:publish - :title-changed - self.title) - - (= pspec.name - "estimated-load-progress") - (bus:publish - :loading-progress - self.estimated_load_progress) - - (= pspec.name "is-loading") - (bus:publish - :loading? self.is_loading) - )) + (match pspec.name + "uri" + (bus:publish :url-changed self.uri) + + "title" + (if (> (self.title:len) 0) + (bus:publish :title-changed self.title)) + + "estimated-load-progress" + (bus:publish :loading-progress self.estimated_load_progress) + + "is-loading" + (bus:publish :loading? self.is_loading) + )) (let [current-url "https://terse.telent.net/admin/stream" bus (event-bus)