mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-02 07:06:41 +03:00
Merge remote-tracking branch 'origin/la/work'
This commit is contained in:
commit
850d78af56
@ -117,7 +117,6 @@
|
||||
!=(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))
|
||||
::
|
||||
@ -132,15 +131,17 @@
|
||||
state(rolodex (~(del by rolodex) ship))
|
||||
::
|
||||
++ handle-edit
|
||||
|= [=ship =edit-field:store]
|
||||
|= [=ship =edit-field:store timestamp=@da]
|
||||
|^
|
||||
^- (quip card _state)
|
||||
=/ old (~(got by rolodex) ship)
|
||||
?: (lte timestamp last-updated.old)
|
||||
[~ state]
|
||||
=/ contact (edit-contact old edit-field)
|
||||
?: =(old contact)
|
||||
[~ state]
|
||||
=. last-updated.contact now.bowl
|
||||
:- (send-diff [%edit ship edit-field] =(ship our.bowl))
|
||||
=. last-updated.contact timestamp
|
||||
:- (send-diff [%edit ship edit-field timestamp] =(ship our.bowl))
|
||||
state(rolodex (~(put by rolodex) ship contact))
|
||||
::
|
||||
++ edit-contact
|
||||
|
@ -42,6 +42,7 @@
|
||||
%- pairs
|
||||
:~ [%ship (ship ship.upd)]
|
||||
[%edit-field (edit edit-field.upd)]
|
||||
[%timestamp (time timestamp.upd)]
|
||||
==
|
||||
::
|
||||
%allow
|
||||
@ -140,6 +141,7 @@
|
||||
%- ot
|
||||
:~ [%ship (su ;~(pfix sig fed:ag))]
|
||||
[%edit-field edit]
|
||||
[%timestamp di]
|
||||
==
|
||||
::
|
||||
++ beings
|
||||
|
@ -32,7 +32,7 @@
|
||||
$% [%initial =rolodex is-public=?]
|
||||
[%add =ship =contact]
|
||||
[%remove =ship]
|
||||
[%edit =ship =edit-field]
|
||||
[%edit =ship =edit-field timestamp=@da]
|
||||
[%allow =beings]
|
||||
[%disallow =beings]
|
||||
[%set-public public=?]
|
||||
|
@ -6,6 +6,7 @@ import { GroupPolicy, Resource } from '~/types/group-update';
|
||||
|
||||
export default class ContactsApi extends BaseApi<StoreState> {
|
||||
add(ship: Patp, contact: any) {
|
||||
contact['last-updated'] = Date.now();
|
||||
return this.storeAction({ add: { ship, contact } });
|
||||
}
|
||||
|
||||
@ -25,11 +26,11 @@ export default class ContactsApi extends BaseApi<StoreState> {
|
||||
{add-group: {ship, name}}
|
||||
{remove-group: {ship, name}}
|
||||
*/
|
||||
console.log(ship, editField);
|
||||
return this.storeAction({
|
||||
edit: {
|
||||
ship,
|
||||
'edit-field': editField,
|
||||
timestamp: Date.now()
|
||||
},
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user