Added new methods to get chat requests
@@ -294,6 +294,15 @@ export function hasSuggestedConnections(atom) {
);
}
+export function hasRequestedConnections(atom) {
+ return (
+ get(atom, "connections") &&
+ !!get(atom, "connections").find(conn =>
+ connectionUtils.isRequestReceived(conn)
+ )
+ );
+}
+
export function getSuggestedConnections(atom) {
return (
get(atom, "connections") &&
@@ -301,6 +310,15 @@ export function getSuggestedConnections(atom) {
);
}
+export function getRequestedConnections(atom) {
+ return (
+ get(atom, "connections") &&
+ get(atom, "connections").filter(conn =>
+ connectionUtils.isRequestReceived(conn)
+ )
+ );
+}
+
export function hasUnreadSuggestedConnections(atom) {
return (
get(atom, "connections") &&
@@ -310,6 +328,7 @@ export function hasUnreadSuggestedConnections(atom) {
);
}
+// to be used on personas
export function hasUnreadBuddyRequests(atom) {
return (
get(atom, "connections") &&
