Open mountiny opened 15 hours ago
Triggered auto assignment to @kadiealexander (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
@mountiny we already have https://github.com/Expensify/App/issues/52818#issuecomment-2488546640 , which is the same, no?
😢 yes, completely forgot, I will update this one
Hey, Im Artem from Callstack and would like to help with this one
@mountiny @joekaufmanexpensify The reason why we have a loader in the company cards and we dont have in expensify cards is here:
const isLoading = !isOffline && (!cardSettings || (cardSettings.isLoading && !cardsList));
And here (cardSettings.isLoading && !cardsList) this part will always return false, even when cardSettings.isLoading is true, because when cardsList is empty, it will return empty Object: "{}", thats why true && false returns false all the time(imo doesnt make any sense), it means that this full expression will be always false when property cardSettings exists.const isLoading = !cardFeeds || !!(cardFeeds.isLoading && !companyCards);
But after this discussion we decided that it doesn't make sense to do this check for company cards as it will always return false as in the expensifyCardsPage (and it makes sense), but in this situation it makes sense also to remove this check in ExpensifyCards too, but in this situation it will add loader to expensifyCards too or just to cut off those expressions and isLoading will look like this:
CompanyCards: const isLoading = !isOffline && !cardFeeds
ExpensifyCards: const isLoading = !isOffline && !cardSettings
In this situation nothing will change for ExpensifyCards, but we will remove loader for CompanyCards.
As we have useFocusEffect(fetchCompanyCards);
and useFocusEffect(fetchExpensifyCards);
we will always have isLoading: true for a component render as we are fetching data each time we are going to those pages
Got it. Does that mean we will change this for company cards further, or leave as is?
Lets try this and see how it feels const isLoading = !isOffline && !cardFeeds
When changing the feed in the list or when closing the feed settings, the company card list is showing spinner incorrectly https://expensify.slack.com/archives/C06ML6X0W9L/p1732197668569719?thread_ts=1732108983.281759&cid=C06ML6X0W9L