Skip to content

Commit

Permalink
Create ReportUtils.isOldDotConciergeChat function
Browse files Browse the repository at this point in the history
  • Loading branch information
cristipaval committed Jan 15, 2024
1 parent 23012c7 commit 020a22b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
9 changes: 9 additions & 0 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,14 @@ function isConciergeChatReport(report: OnyxEntry<Report>): boolean {
return report?.participantAccountIDs?.length === 1 && Number(report.participantAccountIDs?.[0]) === CONST.ACCOUNT_ID.CONCIERGE && !isChatThread(report);
}

/**
* Only returns true if this is a DM report with Concierge, opened from OldDot
*/
function isOldDotConciergeChat(initialURL: string, report: OnyxEntry<Report>): boolean {

return report?.participantAccountIDs?.length === 1 && Number(report.participantAccountIDs?.[0]) === CONST.ACCOUNT_ID.CONCIERGE;
}

/**
* Returns true if report is still being processed
*/
Expand Down Expand Up @@ -4432,6 +4440,7 @@ export {
isPublicRoom,
isPublicAnnounceRoom,
isConciergeChatReport,
isOldDotConciergeChat,
isProcessingReport,
isCurrentUserTheOnlyParticipant,
hasAutomatedExpensifyAccountIDs,
Expand Down
7 changes: 1 addition & 6 deletions src/libs/SessionUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,4 @@ function didUserLogInDuringSession() {
return Boolean(loggedInDuringSession);
}

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

export {isLoggingInAsNewUser, didUserLogInDuringSession, resetDidUserLogInDuringSession, didSessionStartAsOldDotConcierge};
export {isLoggingInAsNewUser, didUserLogInDuringSession, resetDidUserLogInDuringSession};
3 changes: 1 addition & 2 deletions src/pages/home/ReportScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ 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 @@ -353,7 +352,7 @@ function ReportScreen({
Performance.markEnd(CONST.TIMING.CHAT_RENDER);

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

0 comments on commit 020a22b

Please sign in to comment.