Skip to content

Commit

Permalink
Verify if the user comes from OldDot
Browse files Browse the repository at this point in the history
  • Loading branch information
cristipaval committed Jan 15, 2024
1 parent e85c339 commit 23012c7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/libs/SessionUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,9 @@ function didUserLogInDuringSession() {
return Boolean(loggedInDuringSession);
}

export {isLoggingInAsNewUser, didUserLogInDuringSession, resetDidUserLogInDuringSession};
function didSessionStartAsOldDotConcierge(initialURL: string) {
console.debug("CRISTIII - " + initialURL);
return Boolean(true);
}

export {isLoggingInAsNewUser, didUserLogInDuringSession, resetDidUserLogInDuringSession, didSessionStartAsOldDotConcierge};
7 changes: 6 additions & 1 deletion src/pages/home/ReportScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {useIsFocused} from '@react-navigation/native';
import lodashGet from 'lodash/get';
import PropTypes from 'prop-types';
import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react';
import {View} from 'react-native';
import {Linking, View} from 'react-native';
import {withOnyx} from 'react-native-onyx';
import _ from 'underscore';
import Banner from '@components/Banner';
Expand Down Expand Up @@ -44,6 +44,7 @@ import reportActionPropTypes from './report/reportActionPropTypes';
import ReportActionsView from './report/ReportActionsView';
import ReportFooter from './report/ReportFooter';
import {ActionListContext, ReactionListContext} from './ReportScreenContext';
import * as SessionUtils from '@libs/SessionUtils';

const propTypes = {
/** Navigation route context info provided by react navigation */
Expand Down Expand Up @@ -194,6 +195,7 @@ function ReportScreen({
const policy = policies[`${ONYXKEYS.COLLECTION.POLICY}${report.policyID}`] || {};
const isTopMostReportId = currentReportID === getReportID(route);
const didSubscribeToReportLeavingEvents = useRef(false);
const isOldDotConciergeRef = useRef(false);

useEffect(() => {
if (!report || !report.reportID || shouldHideReport) {
Expand Down Expand Up @@ -350,6 +352,9 @@ function ReportScreen({
Timing.end(CONST.TIMING.CHAT_RENDER);
Performance.markEnd(CONST.TIMING.CHAT_RENDER);

Linking.getInitialURL().then((url) => {
isOldDotConciergeRef.current = SessionUtils.didSessionStartAsOldDotConcierge(url);
});
fetchReportIfNeeded();
ComposerActions.setShouldShowComposeInput(true);
return () => {
Expand Down

0 comments on commit 23012c7

Please sign in to comment.