|
|
@@ -33,7 +33,7 @@ import useAuthRoute from '@hooks/useAuthRoute';
|
|
|
// utils
|
|
|
import {StyleSheetManager} from 'styled-components';
|
|
|
import {ThemeProvider as MuiThemeProvider, createTheme} from '@mui/material/styles';
|
|
|
-import {getUrlParam, localStorageSet, preventDefault} from '@utils/helpers';
|
|
|
+import {getUrlParam, localStorageGet, localStorageSet, preventDefault} from '@utils/helpers';
|
|
|
import rtlPlugin from 'stylis-plugin-rtl';
|
|
|
import {CacheProvider} from '@emotion/react';
|
|
|
import createCache from '@emotion/cache';
|
|
|
@@ -206,9 +206,19 @@ const App = () => {
|
|
|
if (userID>0){
|
|
|
if (pathname==="/"){
|
|
|
if(hash==null||hash===""){
|
|
|
+ let key="checkin_open_time";
|
|
|
+ let now=Date.now();
|
|
|
+ let lst=Number(localStorageGet(key,0));
|
|
|
+ let delta=now-lst;
|
|
|
+ if (delta<86400000){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
dispatch(reqCheckinCheck((isCanCheckIn)=>{
|
|
|
if(hash==null||hash===""){
|
|
|
- if(isCanCheckIn===1)navigate(ROUTE_PATH.CHECK_IN,{replace:true});
|
|
|
+ if(isCanCheckIn===1){
|
|
|
+ navigate(ROUTE_PATH.CHECK_IN,{replace:true});
|
|
|
+ localStorageSet(key,Date.now());
|
|
|
+ }
|
|
|
}
|
|
|
}));
|
|
|
return true;
|