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) => { const handleLogin = (email, password) => {
authenticateUser({ variables: { email, password } }) authenticateUser({ variables: { email, password } })
.then(({ data }) => { .then(({ data }) => {
client.cache.reset(); client.resetStore()
updateToken(data.authenticateUser); .then(() => {
history.push('/'); updateToken(data.authenticateUser);
history.push('/');
});
}) })
.catch(() => .catch(() =>
notification.error({ notification.error({