Skip to content

Commit

Permalink
Refetch SharedLayout after login/register
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie committed Dec 2, 2019
1 parent 058e16d commit bfad8c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion @app/client/src/pages/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ function LoginForm({
error,
setError,
}: LoginFormProps) {
const [login] = useLoginMutation();
const [login] = useLoginMutation({
refetchQueries: ["SharedLayout"],
});
const client = useApolloClient();
const validateFields: (
fieldNames?: Array<string>,
Expand Down
4 changes: 3 additions & 1 deletion @app/client/src/pages/register.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ function RegistrationForm({
error,
setError,
}: RegistrationFormProps) {
const [register] = useRegisterMutation();
const [register] = useRegisterMutation({
refetchQueries: ["SharedLayout"],
});
const client = useApolloClient();
const [confirmDirty, setConfirmDirty] = useState(false);

Expand Down

0 comments on commit bfad8c6

Please sign in to comment.