@@ -66,23 +66,22 @@ const SignIn: React.FC<LoginInt & RouteComponentProps> = props => {
66
66
const [ invalidUser , setInvalidUser ] = useState ( false ) ;
67
67
const [ invalidPass , setInvalidPass ] = useState ( false ) ;
68
68
69
-
70
- // useEffect(() => {
71
- // const githubCookie = setInterval(() => {
72
- // window.api.setCookie();
73
- // window.api.getCookie(cookie => {
74
- // // if a cookie exists, set localstorage item with cookie data, clear interval, go back to '/' route to load app
75
- // if (cookie[0]) {
76
- // window.localStorage.setItem('ssid', cookie[0].value);
77
- // clearInterval(githubCookie);
78
- // props.history.push('/');
79
- // // if an item is already set in localstorage (guest option or normal login) clear interval needs to be run or else this will constantly run
80
- // } else if (window.localStorage.getItem('ssid')) {
81
- // clearInterval(githubCookie);
82
- // }
83
- // });
84
- // }, 2000);
85
- // }, []);
69
+ useEffect ( ( ) => {
70
+ const githubCookie = setInterval ( ( ) => {
71
+ window . api . setCookie ( ) ;
72
+ window . api . getCookie ( cookie => {
73
+ // if a cookie exists, set localstorage item with cookie data, clear interval, go back to '/' route to load app
74
+ if ( cookie [ 0 ] ) {
75
+ window . localStorage . setItem ( 'ssid' , cookie [ 0 ] . value ) ;
76
+ clearInterval ( githubCookie ) ;
77
+ props . history . push ( '/' ) ;
78
+ // if an item is already set in localstorage (guest option or normal login) clear interval needs to be run or else this will constantly run
79
+ } else if ( window . localStorage . getItem ( 'ssid' ) ) {
80
+ clearInterval ( githubCookie ) ;
81
+ }
82
+ } ) ;
83
+ } , 2000 ) ;
84
+ } , [ ] ) ;
86
85
87
86
const handleChange = ( e : React . ChangeEvent < HTMLInputElement > ) => {
88
87
let inputVal = e . target . value ;
0 commit comments