diff --git a/pkg/interface/src/views/apps/launch/app.js b/pkg/interface/src/views/apps/launch/app.js
index 2a92f4173..c96574272 100644
--- a/pkg/interface/src/views/apps/launch/app.js
+++ b/pkg/interface/src/views/apps/launch/app.js
@@ -78,7 +78,7 @@ export default class LaunchApp extends React.Component {
weather={props.weather}
/>
-
+
alphabeticalOrder(a.metadata.title, b.metadata.title);
export default function Groups(props: GroupsProps & Parameters[0]) {
- const { associations, ...boxProps } = props;
+ const { associations, invites, api, ...boxProps } = props;
const [recentGroups, setRecentGroups] = useLocalStorageState(
"recent-groups",
[]
);
- const groups = Object.values(props?.associations?.contacts || {})
+ const incomingGroups = Object.values(invites?.['/contacts'] || {});
+ const getKeyByValue = (object, value) => {
+ return Object.keys(object).find(key => object[key] === value);
+ }
+
+ const groups = Object.values(associations?.contacts || {})
.sort(sortGroupsAlph)
.sort(sortGroupsRecent(recentGroups))
@@ -55,6 +60,36 @@ export default function Groups(props: GroupsProps & Parameters[0]) {
gridGap={3}
p={2}
>
+ {incomingGroups.map((invite) => (
+
+ You have been invited to:
+ {invite.path.slice(6)}
+
+ api.invite.accept('/contacts', getKeyByValue(invites['/contacts'], invite))}
+ color='blue'
+ mr='2'
+ cursor='pointer'>
+ Accept
+
+ api.invite.decline('/contacts', getKeyByValue(invites['/contacts'], invite))}
+ cursor='pointer'>
+ Reject
+
+
+
+ ))}
{groups.map((group) => (