From db2a1632fe449c602086dd06fae366a0c84622d2 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Mon, 27 Aug 2018 23:21:34 +0500 Subject: Fix - Redux keeps persisting the groups --- src/redux/github/transform.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/redux/github/transform.js b/src/redux/github/transform.js index af788a6..0602907 100644 --- a/src/redux/github/transform.js +++ b/src/redux/github/transform.js @@ -15,6 +15,16 @@ const GithubTransform = createTransform( }; } + // Keep the first group only to avoid overflowing the storage + if (inboundState.repositories && inboundState.repositories.length > 1) { + inboundState = { + ...inboundState, + repositories: [ + inboundState.repositories[0] + ] + }; + } + return inboundState; }, // transform state being rehydrated -- cgit v1.3