mirror of
https://github.com/urbit/shrub.git
synced 2024-11-24 04:58:08 +03:00
launch: remove groups tile here rather than in contact-view
This commit is contained in:
parent
25e279ed82
commit
64a6e89be6
@ -8,8 +8,7 @@
|
||||
*metadata-store,
|
||||
*metadata-hook,
|
||||
*permission-group-hook,
|
||||
*permission-hook,
|
||||
launch
|
||||
*permission-hook
|
||||
/+ *server, *contact-json, default-agent, dbug
|
||||
/= index
|
||||
/^ octs
|
||||
@ -45,12 +44,7 @@
|
||||
::
|
||||
|%
|
||||
+$ card card:agent:gall
|
||||
+$ state-zero [%0 ~]
|
||||
+$ versioned-state
|
||||
$% state-zero
|
||||
==
|
||||
--
|
||||
=| state-zero
|
||||
=* state -
|
||||
::
|
||||
%- agent:dbug
|
||||
@ -73,19 +67,8 @@
|
||||
(group-poke:cc [%add [our.bowl ~ ~] /~/default])
|
||||
==
|
||||
::
|
||||
++ on-save !>(state)
|
||||
++ on-load
|
||||
|= old=vase
|
||||
=/ pre-versioned=(each ~ tang)
|
||||
(mule |.(!<(~ old)))
|
||||
?: ?=(%.y -.pre-versioned)
|
||||
:_ this(state [%0 ~])
|
||||
[(launch-poke:cc [%remove %contact-view /primary])]~
|
||||
=/ versioned=versioned-state
|
||||
!<(versioned-state old)
|
||||
?- -.versioned
|
||||
%0 [~ this]
|
||||
==
|
||||
++ on-save on-save:def
|
||||
++ on-load on-load:def
|
||||
++ on-poke
|
||||
|= [=mark =vase]
|
||||
^- (quip card _this)
|
||||
@ -234,11 +217,6 @@
|
||||
^- card
|
||||
[%pass / %agent [ship %contact-hook] %poke %contact-action !>(act)]
|
||||
::
|
||||
++ launch-poke
|
||||
|= act=action:launch
|
||||
^- card
|
||||
[%pass / %agent [our.bol %launch] %poke %launch-action !>(act)]
|
||||
::
|
||||
++ group-poke
|
||||
|= act=group-action
|
||||
^- card
|
||||
|
@ -24,18 +24,17 @@
|
||||
::
|
||||
|%
|
||||
+$ versioned-state
|
||||
$% state-zero
|
||||
state-one
|
||||
$% [%0 state-zero]
|
||||
[%1 state-two]
|
||||
[%2 state-two]
|
||||
==
|
||||
+$ state-zero
|
||||
$: %0
|
||||
tiles=(set tile:launch)
|
||||
$: tiles=(set tile:launch)
|
||||
data=tile-data:launch
|
||||
path-to-tile=(map path @tas)
|
||||
==
|
||||
+$ state-one
|
||||
$: %1
|
||||
tiles=(set tile:launch)
|
||||
+$ state-two
|
||||
$: tiles=(set tile:launch)
|
||||
data=tile-data:launch
|
||||
path-to-tile=(map path @tas)
|
||||
first-time=?
|
||||
@ -44,7 +43,7 @@
|
||||
+$ card card:agent:gall
|
||||
--
|
||||
::
|
||||
=| state-one
|
||||
=| [%2 state-two]
|
||||
=* state -
|
||||
%- agent:dbug
|
||||
^- agent:gall
|
||||
@ -53,7 +52,7 @@
|
||||
def ~(. (default-agent this %|) bol)
|
||||
++ on-init
|
||||
^- (quip card _this)
|
||||
:_ this(state *state-one)
|
||||
:_ this(state *[%2 state-two])
|
||||
[%pass / %arvo %e %connect [~ /] %launch]~
|
||||
::
|
||||
++ on-save !>(state)
|
||||
@ -62,14 +61,21 @@
|
||||
|= old=vase
|
||||
^- (quip card _this)
|
||||
=/ old-state !<(versioned-state old)
|
||||
:- ~
|
||||
|-
|
||||
?- -.old-state
|
||||
%0
|
||||
%= this
|
||||
state [%1 tiles.old-state data.old-state path-to-tile.old-state %.n]
|
||||
==
|
||||
$(old-state [%1 tiles.old-state data.old-state path-to-tile.old-state %.n])
|
||||
::
|
||||
%1 this(state old-state)
|
||||
%1
|
||||
=/ new-state=state-two
|
||||
:* (~(del in tiles.old-state) [%contact-view /primary])
|
||||
(~(del by data.old-state) %contact-view)
|
||||
(~(del by path-to-tile.old-state) /primary)
|
||||
first-time.old-state
|
||||
==
|
||||
$(old-state [%2 new-state])
|
||||
::
|
||||
%2 [~ this(state old-state)]
|
||||
==
|
||||
::
|
||||
++ on-poke
|
||||
|
Loading…
Reference in New Issue
Block a user