diff --git a/src/Expensify.js b/src/Expensify.js
index 0707ba069241..074790b81fed 100644
--- a/src/Expensify.js
+++ b/src/Expensify.js
@@ -79,6 +79,9 @@ const propTypes = {
/** Whether we should display the notification alerting the user that focus mode has been auto-enabled */
focusModeNotification: PropTypes.bool,
+ /** Last visited path in the app */
+ lastVisitedPath: PropTypes.string,
+
...withLocalizePropTypes,
};
@@ -92,6 +95,7 @@ const defaultProps = {
screenShareRequest: null,
isCheckingPublicRoom: true,
focusModeNotification: false,
+ lastVisitedPath: undefined,
};
const SplashScreenHiddenContext = React.createContext({});
@@ -102,6 +106,7 @@ function Expensify(props) {
const [isOnyxMigrated, setIsOnyxMigrated] = useState(false);
const [isSplashHidden, setIsSplashHidden] = useState(false);
const [hasAttemptedToOpenPublicRoom, setAttemptedToOpenPublicRoom] = useState(false);
+ const [initialUrl, setInitialUrl] = useState(null);
useEffect(() => {
if (props.isCheckingPublicRoom) {
@@ -182,6 +187,7 @@ function Expensify(props) {
// If the app is opened from a deep link, get the reportID (if exists) from the deep link and navigate to the chat report
Linking.getInitialURL().then((url) => {
+ setInitialUrl(url);
Report.openReportFromDeepLink(url, isAuthenticated);
});
@@ -237,6 +243,8 @@ function Expensify(props) {
)}
@@ -272,6 +280,9 @@ export default compose(
key: ONYXKEYS.FOCUS_MODE_NOTIFICATION,
initWithStoredValues: false,
},
+ lastVisitedPath: {
+ key: ONYXKEYS.LAST_VISITED_PATH,
+ },
}),
)(Expensify);
diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts
index 98e3856f4544..e205a3b01967 100755
--- a/src/ONYXKEYS.ts
+++ b/src/ONYXKEYS.ts
@@ -240,6 +240,9 @@ const ONYXKEYS = {
// Max width supported for HTML