Skip to content

Commit

Permalink
Merge pull request #1981 from Civolilah/bugfix/1663-bitmask-issue
Browse files Browse the repository at this point in the history
[Bugfix] Company Index Issue
  • Loading branch information
beganovich authored Aug 15, 2024
2 parents 2efe827 + 9a8ec55 commit 12b152a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/common/guards/guards/enabled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ import { ModuleBitmask } from '$app/pages/settings/account-management/component'
import { Guard } from '../Guard';

export function enabled(module: ModuleBitmask): Guard {
const index = store.getState().companyUsers.currentIndex;

return () => {
const value = Boolean(
store.getState().companyUsers.api?.[index]?.company?.enabled_modules &
module
store.getState().companyUsers.api?.[
store.getState().companyUsers.currentIndex
]?.company?.enabled_modules & module
);

return new Promise((resolve) => resolve(value));
Expand Down

0 comments on commit 12b152a

Please sign in to comment.