File tree Expand file tree Collapse file tree 3 files changed +12
-9
lines changed
components/HTMLEngineProvider/HTMLRenderers Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import * as Url from '../../../libs/Url';
15
15
import ROUTES from '../../../ROUTES' ;
16
16
import tryResolveUrlFromApiRoot from '../../../libs/tryResolveUrlFromApiRoot' ;
17
17
import useEnvironment from '../../../hooks/useEnvironment' ;
18
+ import * as Session from '../../../libs/actions/Session' ;
18
19
19
20
function AnchorRenderer ( props ) {
20
21
const htmlAttribs = props . tnode . attributes ;
@@ -52,6 +53,10 @@ function AnchorRenderer(props) {
52
53
// If we are handling a New Expensify link then we will assume this should be opened by the app internally. This ensures that the links are opened internally via react-navigation
53
54
// instead of in a new tab or with a page refresh (which is the default behavior of an anchor tag)
54
55
if ( internalNewExpensifyPath && hasSameOrigin ) {
56
+ if ( Session . isAnonymousUser ( ) && ! Session . canAccessRouteByAnonymousUser ( internalNewExpensifyPath ) ) {
57
+ Session . signOutAndRedirectToSignIn ( ) ;
58
+ return ;
59
+ }
55
60
Navigation . navigate ( internalNewExpensifyPath ) ;
56
61
return ;
57
62
}
Original file line number Diff line number Diff line change @@ -12,9 +12,6 @@ import StatusBar from '../StatusBar';
12
12
import useCurrentReportID from '../../hooks/useCurrentReportID' ;
13
13
import useWindowDimensions from '../../hooks/useWindowDimensions' ;
14
14
import { SidebarNavigationContext } from '../../pages/home/sidebar/SidebarNavigationContext' ;
15
- import * as Session from '../actions/Session' ;
16
- import getCurrentUrl from './currentUrl' ;
17
- import ROUTES from '../../ROUTES' ;
18
15
19
16
// https://reactnavigation.org/docs/themes
20
17
const navigationTheme = {
@@ -136,11 +133,6 @@ function NavigationRoot(props) {
136
133
137
134
// Update the global navigation to show the correct selected menu items.
138
135
globalNavigation . updateFromNavigationState ( state ) ;
139
-
140
- const route = Navigation . getActiveRoute ( ) ;
141
- if ( Session . isAnonymousUser ( ) && ! Session . canAccessRouteByAnonymousUser ( route ) && ! getCurrentUrl ( ) . includes ( ROUTES . SIGN_IN_MODAL ) ) {
142
- Session . signOutAndRedirectToSignIn ( ) ;
143
- }
144
136
} ;
145
137
146
138
return (
Original file line number Diff line number Diff line change @@ -1909,7 +1909,13 @@ function openReportFromDeepLink(url, isAuthenticated) {
1909
1909
InteractionManager . runAfterInteractions ( ( ) => {
1910
1910
Session . waitForUserSignIn ( ) . then ( ( ) => {
1911
1911
if ( route === ROUTES . CONCIERGE ) {
1912
- navigateToConciergeChat ( true ) ;
1912
+ navigateToConciergeChat ( ) ;
1913
+ return ;
1914
+ }
1915
+ if ( Session . isAnonymousUser ( ) && ! Session . canAccessRouteByAnonymousUser ( route ) ) {
1916
+ Navigation . isNavigationReady ( ) . then ( ( ) => {
1917
+ Session . signOutAndRedirectToSignIn ( ) ;
1918
+ } ) ;
1913
1919
return ;
1914
1920
}
1915
1921
Navigation . navigate ( route , CONST . NAVIGATION . TYPE . PUSH ) ;
You can’t perform that action at this time.
0 commit comments