From e8825b9788879e9fae9a3b090eca78b6a7fbad71 Mon Sep 17 00:00:00 2001 From: familyfriendlymikey Date: Wed, 17 Aug 2022 08:47:06 -0400 Subject: [PATCH] use immediate invocation of anonymous function instead of set_search_engine --- app/client.imba | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/client.imba b/app/client.imba index 96b8ee2..3bb3037 100644 --- a/app/client.imba +++ b/app/client.imba @@ -260,17 +260,16 @@ tag app def handle_click_config loading = yes - let set_search_engine = do + await (do let input = window.prompt "Please enter the URL of your search engine." return if input === null try - var { href, host } = parse_url input + var { href: url, host } = parse_url input catch e return err "changing search engine", e - config.search_engine.url = href - config.search_engine.icon = await fetch_image_as_base_64 host - save_config! - await set_search_engine! + let icon = await fetch_image_as_base_64 host + Object.assign config.search_engine, { url, icon } + save_config!)! settings_active = no loading = no