From 31f82d4ae380bfa503675d8910852d33ace66f4b Mon Sep 17 00:00:00 2001 From: ronreg-ribdev Date: Sat, 2 Jan 2021 04:10:24 -0800 Subject: [PATCH] Updating state properly --- gall-app/src/index.js | 2 +- gall-app/urbit/app/browsermanager.hoon | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gall-app/src/index.js b/gall-app/src/index.js index 5b5ce51..dfa0920 100644 --- a/gall-app/src/index.js +++ b/gall-app/src/index.js @@ -18,4 +18,4 @@ subscription.start(); ReactDOM.render(( -), document.querySelectorAll("#root")[0]); +), document.querySelectorAll("main")[0]); diff --git a/gall-app/urbit/app/browsermanager.hoon b/gall-app/urbit/app/browsermanager.hoon index fc15626..f74cdad 100644 --- a/gall-app/urbit/app/browsermanager.hoon +++ b/gall-app/urbit/app/browsermanager.hoon @@ -6,15 +6,14 @@ $% [%0 state-0] == +$ state-0 $: - [%access count=@] + access-counts=@ + seen-urls=(set @t) == +$ card card:agent:gall -- ^- agent:gall -=* state :- %0 - :* - [%access count=0] - == +=| state-0 +=* state - |^ :: Main gall core |_ bol=bowl:gall @@ -59,7 +58,8 @@ `this %browsermanager-action =/ action !<(action:browsermanager vase) - [(handle-action action) this] + =/ new-state state(access-counts (add 1 access-counts.state)) + [(handle-action action) this(state new-state)] == ++ on-save ~& 'on-save'