-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve flagging the users as texting Concierge from the OldDot on web #37088
Changes from all commits
afd0f5f
fa2e3ce
0ef8e19
c57bd66
6f1b2e3
7297d97
ba66ff0
036dc29
288ab2c
8fb2888
011db88
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,7 @@ import DateUtils from '@libs/DateUtils'; | |
import * as EmojiUtils from '@libs/EmojiUtils'; | ||
import * as Environment from '@libs/Environment/Environment'; | ||
import * as ErrorUtils from '@libs/ErrorUtils'; | ||
import getPlatform from '@libs/getPlatform'; | ||
import Log from '@libs/Log'; | ||
import Navigation from '@libs/Navigation/Navigation'; | ||
import LocalNotification from '@libs/Notification/LocalNotification'; | ||
|
@@ -175,10 +176,27 @@ const typingWatchTimers: Record<string, NodeJS.Timeout> = {}; | |
|
||
let reportIDDeeplinkedFromOldDot: string | undefined; | ||
Linking.getInitialURL().then((url) => { | ||
const params = new URLSearchParams(url ?? ''); | ||
const exitToRoute = params.get('exitTo') ?? ''; | ||
const {reportID} = ReportUtils.parseReportRouteParams(exitToRoute); | ||
reportIDDeeplinkedFromOldDot = reportID; | ||
const isWeb = ([CONST.PLATFORM.WEB] as unknown as string).includes(getPlatform()); | ||
const currentParams = new URLSearchParams(url ?? ''); | ||
const currentExitToRoute = currentParams.get('exitTo') ?? ''; | ||
const {reportID: currentReportID} = ReportUtils.parseReportRouteParams(currentExitToRoute); | ||
|
||
if (!isWeb) { | ||
reportIDDeeplinkedFromOldDot = currentReportID; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. isn't it possible that someone could click a link in OldDot web and have it open a native app? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tested this scenario a few times. It always opens a browser to handle a deep link. It proposes to open a native app, once you get a report screen opened. Therefore, it does not need to handle the deep link anymore. |
||
|
||
return; | ||
} | ||
|
||
const prevUrl = sessionStorage.getItem(CONST.SESSION_STORAGE_KEYS.INITIAL_URL); | ||
const prevParams = new URLSearchParams(prevUrl ?? ''); | ||
const prevExitToRoute = prevParams.get('exitTo') ?? ''; | ||
const {reportID: prevReportID} = ReportUtils.parseReportRouteParams(prevExitToRoute); | ||
|
||
reportIDDeeplinkedFromOldDot = currentReportID || prevReportID; | ||
|
||
if (currentReportID && url) { | ||
sessionStorage.setItem(CONST.SESSION_STORAGE_KEYS.INITIAL_URL, url); | ||
} | ||
}); | ||
|
||
let lastVisitedPath: string | undefined; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this code is not in compliance with our standards for cross-platform code. @rezkiy37 @abdulrahuman5196 @cristipaval please review App Philosophy with particular emphasis on item 5. Then please open a follow-up PR to implement this in a way that's compliant with our code standards. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. I will prepare an additional PR. Ty!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am preparing a PR to fix it.