From a08e58ca1bb6d6f9790595130dbcd1bb4f63c2e9 Mon Sep 17 00:00:00 2001 From: Mikey Oz Date: Sat, 14 May 2022 08:46:14 -0700 Subject: [PATCH] on handle return search google if there are no results --- app/client.imba | 11 ++++++++--- package.json | 2 +- sw.imba | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/client.imba b/app/client.imba index bbf75b1..623f37a 100644 --- a/app/client.imba +++ b/app/client.imba @@ -48,12 +48,17 @@ tag app def handle_click_link link navigate link + def search_google + window.location.href = 'https://www.google.com/search?q=' + state.query + def handle_return - return if state.scored_links.length < 1 - navigate state.scored_links[0] + if state.scored_links.length < 1 + search_google! + else + navigate state.scored_links[0] def handle_shift_return - window.location.href = 'https://www.google.com/search?q=' + state.query + search_google! def name_exists query for { name } in state.links diff --git a/package.json b/package.json index 1ab8b6d..9984258 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fuzzyhome", - "version": "0.0.20", + "version": "0.0.21", "scripts": { "start": "imba run -SMH --baseurl . -w server.imba", "build-app": "imba build -SMH --baseurl . server.imba", diff --git a/sw.imba b/sw.imba index 2303799..0b521dc 100644 --- a/sw.imba +++ b/sw.imba @@ -1,7 +1,7 @@ let p = console.log const app_prefix = "fuzzyhome_cache" -const version = "0.0.20" +const version = "0.0.21" const cache_name = "{app_prefix}-{version}"