This commit is contained in:
seb
2026-10-28 19:37:28 +01:00
parent 550586f46e
commit b13d994058
2 changed files with 25 additions and 0 deletions

View File

@@ -157,6 +157,9 @@ class CompanySetupDialog extends PureComponent {
componentDidMount() {
this.unsubscribe = companyAutomat.subscribe(this, mapCompanyState);
this.unsubscribeAuth = authAutomat.subscribe(this, (state) => ({
selectedCompanyId: state.user?.selectedCompanyId ?? null,
}));
this.setState(mapCompanyState(companyAutomat.state));
if (companyAutomat.state.status !== 'succeeded') {
void companyAutomat.actions.load().catch(() => {});
@@ -165,6 +168,7 @@ class CompanySetupDialog extends PureComponent {
componentWillUnmount() {
this.unsubscribe?.();
this.unsubscribeAuth?.();
}
async handleSelect(companyId) {
@@ -245,6 +249,10 @@ class CompanySetupDialog extends PureComponent {
}
render() {
if (authAutomat.state.user?.selectedCompanyId != null) {
return null;
}
const {
companies,
loading,