@@ -146,10 +146,10 @@ function SearchAutocompleteList(
146
146
147
147
const { activeWorkspaceID} = useActiveWorkspace ( ) ;
148
148
const policy = usePolicy ( activeWorkspaceID ) ;
149
- const [ betas ] = useOnyx ( ONYXKEYS . BETAS ) ;
150
- const [ recentSearches ] = useOnyx ( ONYXKEYS . RECENT_SEARCHES ) ;
149
+ const [ betas ] = useOnyx ( ONYXKEYS . BETAS , { canBeMissing : true } ) ;
150
+ const [ recentSearches ] = useOnyx ( ONYXKEYS . RECENT_SEARCHES , { canBeMissing : true } ) ;
151
151
const personalDetails = usePersonalDetails ( ) ;
152
- const [ reports = { } ] = useOnyx ( ONYXKEYS . COLLECTION . REPORT ) ;
152
+ const [ reports = { } ] = useOnyx ( ONYXKEYS . COLLECTION . REPORT , { canBeMissing : true } ) ;
153
153
const taxRates = getAllTaxRates ( ) ;
154
154
const { canUseLeftHandBar} = usePermissions ( ) ;
155
155
@@ -169,8 +169,8 @@ function SearchAutocompleteList(
169
169
const expenseTypes = Object . values ( CONST . SEARCH . TRANSACTION_TYPE ) ;
170
170
const booleanTypes = Object . values ( CONST . SEARCH . BOOLEAN ) ;
171
171
172
- const [ userCardList ] = useOnyx ( ONYXKEYS . CARD_LIST ) ;
173
- const [ workspaceCardFeeds ] = useOnyx ( ONYXKEYS . COLLECTION . WORKSPACE_CARDS_LIST ) ;
172
+ const [ userCardList ] = useOnyx ( ONYXKEYS . CARD_LIST , { canBeMissing : true } ) ;
173
+ const [ workspaceCardFeeds ] = useOnyx ( ONYXKEYS . COLLECTION . WORKSPACE_CARDS_LIST , { canBeMissing : true } ) ;
174
174
const allCards = useMemo ( ( ) => mergeCardListWithWorkspaceFeeds ( workspaceCardFeeds ?? CONST . EMPTY_OBJECT , userCardList ) , [ userCardList , workspaceCardFeeds ] ) ;
175
175
const cardAutocompleteList = Object . values ( allCards ) ;
176
176
const cardFeedNamesWithType = useMemo ( ( ) => {
@@ -212,27 +212,27 @@ function SearchAutocompleteList(
212
212
213
213
const taxAutocompleteList = useMemo ( ( ) => getAutocompleteTaxList ( taxRates , policy ) , [ policy , taxRates ] ) ;
214
214
215
- const [ allPolicyCategories ] = useOnyx ( ONYXKEYS . COLLECTION . POLICY_CATEGORIES ) ;
216
- const [ allRecentCategories ] = useOnyx ( ONYXKEYS . COLLECTION . POLICY_RECENTLY_USED_CATEGORIES ) ;
215
+ const [ allPolicyCategories ] = useOnyx ( ONYXKEYS . COLLECTION . POLICY_CATEGORIES , { canBeMissing : false } ) ;
216
+ const [ allRecentCategories ] = useOnyx ( ONYXKEYS . COLLECTION . POLICY_RECENTLY_USED_CATEGORIES , { canBeMissing : true } ) ;
217
217
const categoryAutocompleteList = useMemo ( ( ) => {
218
218
return getAutocompleteCategories ( allPolicyCategories , activeWorkspaceID ) ;
219
219
} , [ activeWorkspaceID , allPolicyCategories ] ) ;
220
220
const recentCategoriesAutocompleteList = useMemo ( ( ) => {
221
221
return getAutocompleteRecentCategories ( allRecentCategories , activeWorkspaceID ) ;
222
222
} , [ activeWorkspaceID , allRecentCategories ] ) ;
223
223
224
- const [ policies = { } ] = useOnyx ( ONYXKEYS . COLLECTION . POLICY ) ;
225
- const [ currentUserLogin ] = useOnyx ( ONYXKEYS . SESSION , { selector : ( session ) => session ?. email } ) ;
224
+ const [ policies = { } ] = useOnyx ( ONYXKEYS . COLLECTION . POLICY , { canBeMissing : false } ) ;
225
+ const [ currentUserLogin ] = useOnyx ( ONYXKEYS . SESSION , { selector : ( session ) => session ?. email , canBeMissing : false } ) ;
226
226
227
227
const workspaceList = Object . values ( policies )
228
228
. filter ( ( singlePolicy ) => ! ! singlePolicy && shouldShowPolicy ( singlePolicy , false , currentUserLogin ) && ! singlePolicy ?. isJoinRequestPending )
229
229
. map ( ( singlePolicy ) => ( { id : singlePolicy ?. id , name : singlePolicy ?. name ?? '' } ) ) ;
230
230
231
- const [ currencyList ] = useOnyx ( ONYXKEYS . CURRENCY_LIST ) ;
231
+ const [ currencyList ] = useOnyx ( ONYXKEYS . CURRENCY_LIST , { canBeMissing : false } ) ;
232
232
const currencyAutocompleteList = Object . keys ( currencyList ?? { } ) . filter ( ( currency ) => ! currencyList ?. [ currency ] ?. retired ) ;
233
- const [ recentCurrencyAutocompleteList ] = useOnyx ( ONYXKEYS . RECENTLY_USED_CURRENCIES ) ;
234
- const [ allPoliciesTags ] = useOnyx ( ONYXKEYS . COLLECTION . POLICY_TAGS ) ;
235
- const [ allRecentTags ] = useOnyx ( ONYXKEYS . COLLECTION . POLICY_RECENTLY_USED_TAGS ) ;
233
+ const [ recentCurrencyAutocompleteList ] = useOnyx ( ONYXKEYS . RECENTLY_USED_CURRENCIES , { canBeMissing : true } ) ;
234
+ const [ allPoliciesTags ] = useOnyx ( ONYXKEYS . COLLECTION . POLICY_TAGS , { canBeMissing : false } ) ;
235
+ const [ allRecentTags ] = useOnyx ( ONYXKEYS . COLLECTION . POLICY_RECENTLY_USED_TAGS , { canBeMissing : true } ) ;
236
236
const tagAutocompleteList = useMemo ( ( ) => {
237
237
return getAutocompleteTags ( allPoliciesTags , activeWorkspaceID ) ;
238
238
} , [ activeWorkspaceID , allPoliciesTags ] ) ;
0 commit comments