@@ -11,7 +11,8 @@ import ONYXKEYS from '@src/ONYXKEYS';
1111import type { MapboxAccessToken , Network } from '@src/types/onyx' ;
1212
1313let authToken : string | undefined ;
14- Onyx . connect ( {
14+ // Use connectWithoutView since this is only for auth token and don't affect to any UI
15+ Onyx . connectWithoutView ( {
1516 key : ONYXKEYS . SESSION ,
1617 callback : ( value ) => {
1718 authToken = value ?. authToken ;
@@ -64,7 +65,8 @@ const init = () => {
6465 }
6566
6667 // When the token changes in Onyx, the expiration needs to be checked so a new token can be retrieved.
67- tokenConnection = Onyx . connect ( {
68+ // Use connectWithoutView since this is only for mapbox token and don't affect to any UI
69+ tokenConnection = Onyx . connectWithoutView ( {
6870 key : ONYXKEYS . MAPBOX_ACCESS_TOKEN ,
6971 callback : ( token ) => {
7072 // Only the leader should be in charge of the mapbox token, or else when you have multiple tabs open, the Onyx connection fires multiple times
@@ -119,7 +121,8 @@ const init = () => {
119121
120122 if ( ! networkConnection ) {
121123 let network : Network | undefined ;
122- networkConnection = Onyx . connect ( {
124+ // Use connectWithoutView since the network state and don't affect to any UI
125+ networkConnection = Onyx . connectWithoutView ( {
123126 key : ONYXKEYS . NETWORK ,
124127 callback : ( value ) => {
125128 // When the network reconnects, check if the token has expired. If it has, then clearing the token will
0 commit comments