Not loading large company after login when switching companies

This commit is contained in:
Hillel Coren 2021-11-04 09:52:56 +02:00
parent 8af8f3d317
commit c4a0c956d3
1 changed files with 4 additions and 6 deletions

View File

@ -92,13 +92,11 @@ class MenuDrawerVM {
store.dispatch(ClearEntityFilter()); store.dispatch(ClearEntityFilter());
store.dispatch(DiscardChanges()); store.dispatch(DiscardChanges());
store.dispatch(SelectCompany(companyIndex: index)); store.dispatch(SelectCompany(companyIndex: index));
if (store.state.isStale) { if (store.state.company.isLarge && !store.state.isLoaded) {
if (!store.state.isLoaded && store.state.company.isLarge) {
store.dispatch(LoadClients()); store.dispatch(LoadClients());
} else { } else if (store.state.isStale) {
store.dispatch(RefreshData()); store.dispatch(RefreshData());
} }
}
AppBuilder.of(context).rebuild(); AppBuilder.of(context).rebuild();
final uiState = state.uiState; final uiState = state.uiState;