TP-35796 | changed activity time window to 10
This commit is contained in:
@@ -74,7 +74,6 @@ public class MainApplication extends Application implements ReactApplication {
|
||||
if (BuildConfig.DEBUG) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -53,7 +53,6 @@ const TrackingComponent: React.FC<ITrackingComponent> = ({ children }) => {
|
||||
const dispatch = useAppDispatch();
|
||||
const appState = useRef(AppState.currentState);
|
||||
const user = useAppSelector((state) => state.user);
|
||||
const isActive = useAppSelector((state) => state?.user?.user?.isActive);
|
||||
|
||||
const {
|
||||
referenceId,
|
||||
@@ -132,6 +131,10 @@ const TrackingComponent: React.FC<ITrackingComponent> = ({ children }) => {
|
||||
};
|
||||
|
||||
const handleUpdateActiveness = async () => {
|
||||
if (AppState.currentState === AppStates.ACTIVE) {
|
||||
await setItem(StorageKeys.IS_USER_ACTIVE, 'true');
|
||||
return;
|
||||
}
|
||||
const foregroundTimestamp = await getItem(StorageKeys.APP_FOREGROUND_TIMESTAMP);
|
||||
const backgroundTimestamp = await getItem(StorageKeys.APP_BACKGROUND_TIMESTAMP);
|
||||
const foregroundTime = dayjs(foregroundTimestamp);
|
||||
@@ -145,13 +148,7 @@ const TrackingComponent: React.FC<ITrackingComponent> = ({ children }) => {
|
||||
const isForegroundTimeWithInRange =
|
||||
diffBetweenCurrentTimeAndForegroundTime <= ACTIVITY_TIME_WINDOW;
|
||||
const isForegroundTimeAfterBackground = dayjs(foregroundTimestamp).isAfter(backgroundTimestamp);
|
||||
console.log({
|
||||
diffBetweenBackgroundAndForegroundTime,
|
||||
diffBetweenCurrentTimeAndForegroundTime,
|
||||
isForegroundTimeWithInRange,
|
||||
isForegroundTimeAfterBackground,
|
||||
dayjs: dayjs().toString(),
|
||||
});
|
||||
|
||||
if (isForegroundTimeWithInRange) {
|
||||
if (
|
||||
isForegroundTimeAfterBackground ||
|
||||
|
||||
Reference in New Issue
Block a user