From 8e1aeefdbbfb341eabb69446c200da7dfdb6b3c6 Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Thu, 4 Jun 2020 17:36:07 -0400 Subject: [PATCH] invites: fixed %initial --- pkg/arvo/app/invite-view.hoon | 74 --------------------- pkg/interface/src/reducers/invite-update.js | 1 + pkg/interface/src/subscription/chat.js | 2 +- pkg/interface/src/subscription/global.js | 2 +- pkg/interface/src/subscription/groups.js | 2 +- pkg/interface/src/subscription/links.js | 2 +- pkg/interface/src/subscription/publish.js | 2 +- 7 files changed, 6 insertions(+), 79 deletions(-) delete mode 100644 pkg/arvo/app/invite-view.hoon diff --git a/pkg/arvo/app/invite-view.hoon b/pkg/arvo/app/invite-view.hoon deleted file mode 100644 index 82cdf18df..000000000 --- a/pkg/arvo/app/invite-view.hoon +++ /dev/null @@ -1,74 +0,0 @@ -:: invite-view: provide a json interface to invite-store -:: -:: accepts subscriptions at the /primary path. -:: passes through all invites and their updates. -:: only accepts subcriptions from the host's team. -:: -::TODO could maybe use /lib/proxy-hook, be renamed invite-proxy-hook -:: -/+ *invite-json, default-agent, dbug -:: -|% -+$ card card:agent:gall --- -:: -=> - |% - ++ watch-updates - |= our=ship - ^- card - [%pass /store %agent [our %invite-store] %watch /updates] - -- -:: -%- agent:dbug -^- agent:gall -|_ =bowl:gall -+* this . - def ~(. (default-agent this %|) bowl) -:: -++ on-init - ^- (quip card _this) - [[(watch-updates our.bowl)]~ this] -:: -++ on-save on-save:def -++ on-load - |= old=vase - ^- (quip card _this) - [~ this] -:: -++ on-watch - |= =path - ^- (quip card _this) - ?> (team:title our.bowl src.bowl) - ?. =(/primary path) - (on-watch:def path) - :_ this - =/ =invites - .^(invites %gx /=invite-store/(scot %da now.bowl)/all/noun) - [%give %fact ~ %json !>((invites-to-json invites))]~ -:: -++ on-agent - |= [=wire =sign:agent:gall] - ^- (quip card _this) - :_ this - ?- -.sign - %poke-ack ~|([dap.bowl %unexpected-poke-ack] !!) - %watch-ack ~ - %kick [(watch-updates our.bowl)]~ - :: - %fact - ~| [dap.bowl %unexpected-fact-mark p.cage.sign] - ?> ?=(%invite-update p.cage.sign) - :~ :* - %give %fact - ~[/primary] %json - !>((update-to-json !<(invite-update q.cage.sign))) - == == - == -:: -++ on-poke on-poke:def -++ on-peek on-peek:def -++ on-leave on-leave:def -++ on-arvo on-arvo:def -++ on-fail on-fail:def --- diff --git a/pkg/interface/src/reducers/invite-update.js b/pkg/interface/src/reducers/invite-update.js index fb10d2b55..d9be947d0 100644 --- a/pkg/interface/src/reducers/invite-update.js +++ b/pkg/interface/src/reducers/invite-update.js @@ -4,6 +4,7 @@ export default class InviteReducer { reduce(json, state) { const data = _.get(json, 'invite-update', false); if (data) { + console.log(data); this.initial(data, state); this.create(data, state); this.delete(data, state); diff --git a/pkg/interface/src/subscription/chat.js b/pkg/interface/src/subscription/chat.js index 97e024116..c29d9ce4d 100644 --- a/pkg/interface/src/subscription/chat.js +++ b/pkg/interface/src/subscription/chat.js @@ -5,7 +5,7 @@ export default class ChatSubscription extends BaseSubscription { this.subscribe('/primary', 'chat-view'); setTimeout(() => { this.subscribe('/synced', 'chat-hook'); - this.subscribe('/primary', 'invite-view'); + this.subscribe('/all', 'invite-store'); this.subscribe('/all', 'permission-store'); this.subscribe('/primary', 'contact-view'); this.subscribe('/app-name/chat', 'metadata-store'); diff --git a/pkg/interface/src/subscription/global.js b/pkg/interface/src/subscription/global.js index 11b42958f..993b885aa 100644 --- a/pkg/interface/src/subscription/global.js +++ b/pkg/interface/src/subscription/global.js @@ -2,7 +2,7 @@ import BaseSubscription from './base'; export default class GlobalSubscription extends BaseSubscription { start() { - this.subscribe('/primary', 'invite-view'); + this.subscribe('/all', 'invite-store'); this.subscribe('/app-name/contacts', 'metadata-store'); } } diff --git a/pkg/interface/src/subscription/groups.js b/pkg/interface/src/subscription/groups.js index f104c4eb7..df3d7f491 100644 --- a/pkg/interface/src/subscription/groups.js +++ b/pkg/interface/src/subscription/groups.js @@ -6,7 +6,7 @@ export default class GroupsSubscription extends BaseSubscription { this.subscribe('/all', 'group-store'); this.subscribe('/all', 'metadata-store'); this.subscribe('/synced', 'contact-hook'); - this.subscribe('/primary', 'invite-view'); + this.subscribe('/all', 'invite-store'); this.subscribe('/all', 's3-store'); } } diff --git a/pkg/interface/src/subscription/links.js b/pkg/interface/src/subscription/links.js index 0112bbd77..30adddd76 100644 --- a/pkg/interface/src/subscription/links.js +++ b/pkg/interface/src/subscription/links.js @@ -4,7 +4,7 @@ export default class LinksSubscription extends BaseSubscription { start() { this.subscribe('/all', 'group-store'); this.subscribe('/primary', 'contact-view'); - this.subscribe('/primary', 'invite-view'); + this.subscribe('/all', 'invite-store'); this.subscribe('/app-name/link', 'metadata-store'); this.subscribe('/app-name/contacts', 'metadata-store'); this.subscribe('/listening', 'link-listen-hook'); diff --git a/pkg/interface/src/subscription/publish.js b/pkg/interface/src/subscription/publish.js index 31076e067..9a7c08599 100644 --- a/pkg/interface/src/subscription/publish.js +++ b/pkg/interface/src/subscription/publish.js @@ -5,7 +5,7 @@ export default class PublishSubscription extends BaseSubscription { this.subscribe('/primary', 'publish'); this.subscribe('/all', 'group-store'); this.subscribe('/primary', 'contact-view'); - this.subscribe('/primary', 'invite-view'); + this.subscribe('/all', 'invite-store'); this.subscribe('/all', 'permission-store'); this.subscribe('/app-name/contacts', 'metadata-store'); }