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,12 +92,10 @@ class MenuDrawerVM {
store.dispatch(ClearEntityFilter());
store.dispatch(DiscardChanges());
store.dispatch(SelectCompany(companyIndex: index));
if (store.state.isStale) {
if (!store.state.isLoaded && store.state.company.isLarge) {
store.dispatch(LoadClients());
} else {
store.dispatch(RefreshData());
}
if (store.state.company.isLarge && !store.state.isLoaded) {
store.dispatch(LoadClients());
} else if (store.state.isStale) {
store.dispatch(RefreshData());
}
AppBuilder.of(context).rebuild();