Browse Source

on handle return search google if there are no results

main
Mikey Oz 3 years ago
parent
commit
a08e58ca1b
  1. 9
      app/client.imba
  2. 2
      package.json
  3. 2
      sw.imba

9
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
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

2
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",

2
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}"

Loading…
Cancel
Save