@@ -5,10 +5,10 @@ import { nativeApplicationVersion } from 'expo-application';
5
5
// $FlowFixMe[untyped-import]
6
6
import md5 from 'blueimp-md5' ;
7
7
8
- import type { AccountStatus } from './account/accountsSelectors ' ;
8
+ import type { Identity } from './types ' ;
9
9
import isAppOwnDomain from './isAppOwnDomain' ;
10
10
import store from './boot/store' ;
11
- import { getAccountStatuses } from './account/accountsSelectors' ;
11
+ import { getIdentities } from './account/accountsSelectors' ;
12
12
import { sentryKey } from './sentryConfig' ;
13
13
import { isUrlOnRealm } from './utils/url' ;
14
14
@@ -70,7 +70,7 @@ type HttpBreadcrumb = $ReadOnly<{|
70
70
| } ,
71
71
| } > ;
72
72
73
- function shouldScrubHost ( url : URL , accountStatuses : $ReadOnlyArray < AccountStatus > ) {
73
+ function shouldScrubHost ( url : URL , identities : $ReadOnlyArray < Identity > ) {
74
74
if ( isAppOwnDomain ( url ) ) {
75
75
return false ;
76
76
}
@@ -82,7 +82,7 @@ function shouldScrubHost(url: URL, accountStatuses: $ReadOnlyArray<AccountStatus
82
82
return true ;
83
83
}
84
84
85
- if ( accountStatuses . some ( ( { realm } ) => isUrlOnRealm ( url , realm ) ) ) {
85
+ if ( identities . some ( ( { realm } ) => isUrlOnRealm ( url , realm ) ) ) {
86
86
// Definitely a request to a Zulip realm. Will catch requests to realms
87
87
// in the account-statuses state, including those without `/api/v1`,
88
88
// like `/avatar/{user_id}` (zulip/zulip@0f9970fd3 confirms that this
@@ -99,8 +99,8 @@ function scrubUrl(unscrubbedUrl: void | string): void | string {
99
99
}
100
100
101
101
const parsedUrl = new URL ( unscrubbedUrl ) ;
102
- const accountStatuses = getAccountStatuses ( store . getState ( ) ) ;
103
- if ( ! shouldScrubHost ( parsedUrl , accountStatuses ) ) {
102
+ const identities = getIdentities ( store . getState ( ) ) ;
103
+ if ( ! shouldScrubHost ( parsedUrl , identities ) ) {
104
104
return unscrubbedUrl ;
105
105
}
106
106
0 commit comments