diff --git a/src/components/Amicale/Login/LoginForm.tsx b/src/components/Amicale/Login/LoginForm.tsx index 4fbcf60..91bef60 100644 --- a/src/components/Amicale/Login/LoginForm.tsx +++ b/src/components/Amicale/Login/LoginForm.tsx @@ -22,7 +22,7 @@ type Props = { onResetPasswordPress: () => void; }; -const ICON_AMICALE = require('../../../assets/amicale.png'); +const ICON_AMICALE = require('../../../../assets/amicale.png'); const styles = StyleSheet.create({ card: { diff --git a/src/components/Amicale/LogoutDialog.tsx b/src/components/Amicale/LogoutDialog.tsx index 8d2759c..e0a6705 100644 --- a/src/components/Amicale/LogoutDialog.tsx +++ b/src/components/Amicale/LogoutDialog.tsx @@ -33,6 +33,7 @@ function LogoutDialog(props: PropsType) { const onClickAccept = async (): Promise => { return new Promise((resolve: () => void) => { onLogout(); + props.onDismiss(); resolve(); }); }; diff --git a/src/components/Amicale/Vote/VoteSelect.tsx b/src/components/Amicale/Vote/VoteSelect.tsx index fc290c0..82eff99 100644 --- a/src/components/Amicale/Vote/VoteSelect.tsx +++ b/src/components/Amicale/Vote/VoteSelect.tsx @@ -128,7 +128,10 @@ function VoteSelect(props: Props) { message={i18n.t('screens.vote.select.dialogMessage')} /> ; function LoginScreen(props: Props) { const navigation = useNavigation>(); + const { setLogin } = useLogin(); const [loading, setLoading] = useState(false); const [nextScreen, setNextScreen] = useState(undefined); const [mascotDialogVisible, setMascotDialogVisible] = useState(false); @@ -88,11 +90,12 @@ function LoginScreen(props: Props) { * Navigates to the screen specified in navigation parameters or simply go back tha stack. * Saves in user preferences to not show the login banner again. */ - const handleSuccess = () => { + const handleSuccess = (token: string) => { // Do not show the home login banner again if (homeMascot.shouldShow) { homeMascot.setShouldShow(false); } + setLogin(token); if (!nextScreen) { navigation.goBack(); } else { @@ -138,7 +141,10 @@ function LoginScreen(props: Props) { emotion={MASCOT_STYLE.NORMAL} />