contact-store: changed semantics to no-op instead of crash
^- (quip card _state)
:: ensure difference
=/ old=(unit contact:store) (~(get by rolodex) ship)
- ?> ?| ?=(~ old)
+ ?. ?| ?=(~ old)
!=(contact(last-updated *@da) u.old(last-updated *@da))
==
+ [~ state]
=. last-updated.contact now.bowl
:- (send-diff [%add ship contact] =(ship our.bowl))
state(rolodex (~(put by rolodex) ship contact))
++ handle-remove
|= =ship
^- (quip card _state)
- ?> (~(has by rolodex) ship)
+ ?. (~(has by rolodex) ship)
+ [~ state]
:- (send-diff [%remove ship] =(ship our.bowl))
?: =(ship our.bowl)
state(rolodex (~(put by rolodex) our.bowl *contact:store))
|= [=ship =edit-field:store]
|^
^- (quip card _state)
- =/ contact (~(got by rolodex) ship)
- =. contact (edit-contact contact edit-field)
+ =/ old (~(got by rolodex) ship)
+ =/ contact (edit-contact old edit-field)
+ ?: =(old contact)
+ [~ state]
=. last-updated.contact now.bowl
:- (send-diff [%edit ship edit-field] =(ship our.bowl))
state(rolodex (~(put by rolodex) ship contact))
++ edit-contact
|= [=contact:store edit=edit-field:store]
^- contact:store
- :: ensure difference
- =; new=contact:store
- ?<(=(contact new) new)
?- -.edit
%nickname contact(nickname nickname.edit)
%bio contact(bio bio.edit)
