Fix Yt sync page

This commit is contained in:
Rafael 2021-12-21 16:01:27 -03:00 committed by Thomas Zarebczan
parent 7757960d96
commit 45de6ab822

View file

@ -85,6 +85,7 @@ const Header = (props: Props) => {
const isSignUpPage = pathname.includes(PAGES.AUTH); const isSignUpPage = pathname.includes(PAGES.AUTH);
const isSignInPage = pathname.includes(PAGES.AUTH_SIGNIN); const isSignInPage = pathname.includes(PAGES.AUTH_SIGNIN);
const isPwdResetPage = pathname.includes(PAGES.AUTH_PASSWORD_RESET); const isPwdResetPage = pathname.includes(PAGES.AUTH_PASSWORD_RESET);
const iYTSyncPage = pathname.includes(PAGES.YOUTUBE_SYNC);
// For pages that allow for "backing out", shows a backout option instead of the Home logo // For pages that allow for "backing out", shows a backout option instead of the Home logo
const canBackout = Boolean(backout); const canBackout = Boolean(backout);
@ -255,12 +256,14 @@ const Header = (props: Props) => {
// className="button--header-close" // className="button--header-close"
icon={ICONS.REMOVE} icon={ICONS.REMOVE}
onClick={() => { onClick={() => {
clearEmailEntry(); if (!iYTSyncPage) {
clearPasswordEntry(); clearEmailEntry();
clearPasswordEntry();
}
if (syncError) signOut(); if (syncError) signOut();
if ((isSignInPage && !emailToVerify) || isSignUpPage || isPwdResetPage) { if ((isSignInPage && !emailToVerify) || isSignUpPage || isPwdResetPage || iYTSyncPage) {
goBack(); goBack();
} else { } else {
push('/'); push('/');