From 0939aacdbea0346365a8c496ff368a8a29f3aecd Mon Sep 17 00:00:00 2001 From: Hassan Azmi Date: Wed, 19 Aug 2020 12:46:04 -0400 Subject: [PATCH] Make resetting the store synchronous --- app/containers/Login/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/containers/Login/index.js b/app/containers/Login/index.js index 2320d38..568f15c 100644 --- a/app/containers/Login/index.js +++ b/app/containers/Login/index.js @@ -27,9 +27,11 @@ const Login = () => { const handleLogin = (email, password) => { authenticateUser({ variables: { email, password } }) .then(({ data }) => { - client.cache.reset(); - updateToken(data.authenticateUser); - history.push('/'); + client.resetStore() + .then(() => { + updateToken(data.authenticateUser); + history.push('/'); + }); }) .catch(() => notification.error({