Browse Source

fix config reset

main
familyfriendlymikey 2 years ago
parent
commit
e98a41f09d
  1. 11
      app/client.imba
  2. 2
      package.json

11
app/client.imba

@ -46,7 +46,7 @@ tag app
unless global.localStorage.fuzzyhome_visited unless global.localStorage.fuzzyhome_visited
await add_initial_links! await add_initial_links!
global.localStorage.fuzzyhome_visited = yes global.localStorage.fuzzyhome_visited = yes
load_config! await load_config!
def add_initial_links def add_initial_links
await add_link { name: "help", url: "github.com/familyfriendlymikey/fuzzyhome" } await add_link { name: "help", url: "github.com/familyfriendlymikey/fuzzyhome" }
@ -55,11 +55,12 @@ tag app
await add_link { name: "3000", url: "localhost:3000" } await add_link { name: "3000", url: "localhost:3000" }
def validate_config def validate_config
throw 'config error' unless config..search_engine..url throw 'config error' unless config..search_engine.hasOwnProperty 'url'
throw 'config error' unless config..search_engine..frequency throw 'config error' unless config..search_engine.hasOwnProperty 'icon'
throw 'config error' unless config..search_engine..icon throw 'config error' unless config..search_engine.hasOwnProperty 'frequency'
def reset_config def reset_config
p "resetting config"
let url = 'www.google.com/search?q=' let url = 'www.google.com/search?q='
let frequency = 0 let frequency = 0
let icon = await fetch_image_as_base_64 'google.com' let icon = await fetch_image_as_base_64 'google.com'
@ -74,7 +75,7 @@ tag app
config = JSON.parse(global.localStorage.fuzzyhome_config) config = JSON.parse(global.localStorage.fuzzyhome_config)
validate_config! validate_config!
catch catch
reset_config! await reset_config!
def err s, e def err s, e
p e p e

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "fuzzyhome", "name": "fuzzyhome",
"version": "0.1.26", "version": "0.1.27",
"scripts": { "scripts": {
"start": "imba run -SMH --baseurl . -w server.imba", "start": "imba run -SMH --baseurl . -w server.imba",
"build-app": "rm -rf dist && imba build -SMH --baseurl . server.imba", "build-app": "rm -rf dist && imba build -SMH --baseurl . server.imba",

Loading…
Cancel
Save