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))
|
!=(contact(last-updated *@da) u.old(last-updated *@da))
|
||||||
==
|
==
|
||||||
[~ state]
|
[~ state]
|
||||||
=. last-updated.contact now.bowl
|
|
||||||
:- (send-diff [%add ship contact] =(ship our.bowl))
|
:- (send-diff [%add ship contact] =(ship our.bowl))
|
||||||
state(rolodex (~(put by rolodex) ship contact))
|
state(rolodex (~(put by rolodex) ship contact))
|
||||||
::
|
::
|
||||||
@ -141,7 +140,7 @@
|
|||||||
=/ contact (edit-contact old edit-field)
|
=/ contact (edit-contact old edit-field)
|
||||||
?: =(old contact)
|
?: =(old contact)
|
||||||
[~ state]
|
[~ state]
|
||||||
=. last-updated.contact now.bowl
|
=. last-updated.contact timestamp
|
||||||
:- (send-diff [%edit ship edit-field] =(ship our.bowl))
|
:- (send-diff [%edit ship edit-field] =(ship our.bowl))
|
||||||
state(rolodex (~(put by rolodex) ship contact))
|
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> {
|
export default class ContactsApi extends BaseApi<StoreState> {
|
||||||
add(ship: Patp, contact: any) {
|
add(ship: Patp, contact: any) {
|
||||||
|
contact['last-updated'] = Date.now();
|
||||||
return this.storeAction({ add: { ship, contact } });
|
return this.storeAction({ add: { ship, contact } });
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -25,11 +26,11 @@ export default class ContactsApi extends BaseApi<StoreState> {
|
|||||||
{add-group: {ship, name}}
|
{add-group: {ship, name}}
|
||||||
{remove-group: {ship, name}}
|
{remove-group: {ship, name}}
|
||||||
*/
|
*/
|
||||||
console.log(ship, editField);
|
|
||||||
return this.storeAction({
|
return this.storeAction({
|
||||||
edit: {
|
edit: {
|
||||||
ship,
|
ship,
|
||||||
'edit-field': editField,
|
'edit-field': editField,
|
||||||
|
timestamp: Date.now()
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user