Adds reducer method for storing connections that have failed to load
@@ -507,6 +507,7 @@ export function addActiveConnectionToNeed(state, needUri, connUri) {
isRated: false,
isLoadingMessages: false,
isLoading: true,
+ failedToLoad: false,
showAgreementData: false,
});
@@ -515,3 +516,16 @@ export function addActiveConnectionToNeed(state, needUri, connUri) {
return state;
}
+
+export function addFailedToStoreConnection(state, connUri) {
+ const needOfConnection = connUri && getOwnedNeedByConnectionUri(connUri);
+
+ if (needOfConnection) {
+ const needUri = needOfConnection.get("uri");
+
+ return state
+ .setIn([needUri, "connections", connUri, "isLoading"], false)
+ .setIn([needUri, "connections", connUri, "failedToLoad"], true);
+ }
+ return state;
+}
