Skip to content

Commit fc8e850

Browse files
authored
Merge pull request #166 from mikeattara/patch-1
use finally to remove duplication
2 parents d40b1a5 + fafefa9 commit fc8e850

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

auth/useCreateUserWithEmailAndPassword.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ export default (
3434
);
3535
}
3636
setRegisteredUser(user);
37-
setLoading(false);
3837
} catch (error) {
3938
setError(error as AuthError);
39+
} finally {
4040
setLoading(false);
4141
}
4242
};

auth/useSignInWithEmailAndPassword.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ export default (auth: Auth): EmailAndPasswordActionHook => {
2424
password
2525
);
2626
setLoggedInUser(user);
27-
setLoading(false);
2827
} catch (err) {
2928
setError(err as AuthError);
29+
} finally {
3030
setLoading(false);
3131
}
3232
};

0 commit comments

Comments
 (0)