Make resetting the store synchronous

This commit is contained in:
Hassan Azmi
2020-08-19 12:46:04 -04:00
parent 2d7514fbde
commit 0939aacdbe

View File

@@ -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({