diff --git a/pkg/interface/src/views/apps/notifications/inbox.tsx b/pkg/interface/src/views/apps/notifications/inbox.tsx index 93deb8674..2338e7a2b 100644 --- a/pkg/interface/src/views/apps/notifications/inbox.tsx +++ b/pkg/interface/src/views/apps/notifications/inbox.tsx @@ -87,15 +87,24 @@ export default function Inbox(props: { } }, [props.showArchive]); - const acceptInvite = async (invite) => { + const acceptInvite = (app: string, uid: string) => async (invite) => { const resource = { ship: `~${invite.resource.ship}`, name: invite.resource.name }; - await api.contacts.join(resource); - await api.invite.accept('contacts', getKeyByValue(invites['contacts'], invite)); - const path = resourceAsPath(invite.resource) - await waiter(p => path in p.associations?.contacts); + + let resourcePath = resourceAsPath(invite.resource); + if(app === 'chat') { + resourcePath = resourcePath.slice(5); + } + + let path = `/home/resource/${app}${resourcePath}`; + if(app === 'contacts') { + await api.contacts.join(resource); + path = resourceAsPath(invite.resource); + await waiter(p => path in p.associations?.contacts); + } + await api.invite.accept(app, uid); history.push(`/~landscape${path}`); }; @@ -110,7 +119,7 @@ export default function Inbox(props: { api.invite.decline(appKey, uid)} />; returned.push(inviteItem);