mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-02 07:06:41 +03:00
contact-store: set last-updated appropriately and send last-updated in JS
This commit is contained in:
parent
f0a86b2de3
commit
1ddf9f5b84
@ -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))
|
||||
::
|
||||
@ -141,7 +140,7 @@
|
||||
=/ contact (edit-contact old edit-field)
|
||||
?: =(old contact)
|
||||
[~ state]
|
||||
=. last-updated.contact now.bowl
|
||||
=. last-updated.contact timestamp
|
||||
:- (send-diff [%edit ship edit-field] =(ship our.bowl))
|
||||
state(rolodex (~(put by rolodex) ship contact))
|
||||
::
|
||||
|
@ -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