diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..390c31c3 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +steria.json +steriaGarb.json \ No newline at end of file diff --git a/src/components/login/google/YTM.tsx b/src/components/login/google/YTM.tsx index afd3dfd4..cea232de 100644 --- a/src/components/login/google/YTM.tsx +++ b/src/components/login/google/YTM.tsx @@ -7,7 +7,6 @@ import CookieManager from '@react-native-cookies/cookies'; import { get_option, get_current_user } from 'libmuse'; import { useTranslation } from 'react-i18next'; -import useGoogleTVOauth from '@components/login/google/useGoogleTVOauth'; import { saveSecure as saveItem } from '@utils/ChromeStorageAPI'; import { StorageKeys } from '@enums/Storage'; import { User, UseYTMLogin } from './useYTMLogin'; @@ -24,10 +23,7 @@ const clearCookies = () => { const checkYTM = async () => console.log(await get_current_user()); -interface LoginProps { - refresh: () => void; -} -const Login = ({ refresh }: LoginProps) => { +const Login = () => { const { t } = useTranslation(); const [webView, _setWebView] = useState(false); const [cookies, setCookies] = useState([]); @@ -36,9 +32,6 @@ const Login = ({ refresh }: LoginProps) => { _setWebView(val); toggleCollapse(val); }; - const { userURL, loginCodes, getNewLoginCode } = useGoogleTVOauth({ - setWebView, - }); const onMessage = (event: any) => { const { data } = event.nativeEvent; @@ -57,12 +50,6 @@ const Login = ({ refresh }: LoginProps) => { value, }); }); - auth - .load_token_with_code(loginCodes!.deviceCode, loginCodes!.interval) - .then(t => { - museStore.set('token', t); - refresh(); - }); saveItem(StorageKeys.YTMCOOKIES, cookies.join('; ')); return true; } @@ -80,14 +67,16 @@ const Login = ({ refresh }: LoginProps) => { return webView ? ( ) : ( {__DEV__ && } - + ); @@ -123,7 +112,7 @@ interface Props { ytmLogin: UseYTMLogin; } const Explore = ({ ytmLogin }: Props) => { - const { user, clear, initialized, refresh, init } = ytmLogin; + const { user, clear, initialized, init } = ytmLogin; useEffect(() => { init(); @@ -143,7 +132,7 @@ const Explore = ({ ytmLogin }: Props) => { }} /> ) : ( - + ); };