- updated dependencies;
- fixed displaying delega; - fixed switching companies; - added toast for profile and company profile; - fixed registration 'deby/allow all' func;
This commit is contained in:
@@ -19,8 +19,7 @@ const TopBarProfileMenu = ({ menuLeftRef }) => {
|
||||
const [companyItems, setCompanyItems] = useState([]);
|
||||
const renderCompanyItem = (item) => (
|
||||
<span className="topBar__menuCompanyItem"
|
||||
onClick={chosenCompanyId === item.companyId ? () => {
|
||||
} : () => switchCompany(item.companyId)}
|
||||
onClick={() => switchCompany(item.companyId)}
|
||||
data-id={item.companyId}
|
||||
data-active={chosenCompanyId === item.companyId}>
|
||||
<i className="pi pi-building-columns"></i>
|
||||
@@ -83,7 +82,9 @@ const TopBarProfileMenu = ({ menuLeftRef }) => {
|
||||
].filter(o => o.enable);
|
||||
|
||||
const switchCompany = (id) => {
|
||||
console.log('switchCompany');
|
||||
if (chosenCompanyId !== id) {
|
||||
storeSet.main.chosenCompanyId(id);
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
@@ -93,7 +94,7 @@ const TopBarProfileMenu = ({ menuLeftRef }) => {
|
||||
template: renderCompanyItem
|
||||
}));
|
||||
setCompanyItems(items)
|
||||
}, [companies])
|
||||
}, [companies, chosenCompanyId])
|
||||
|
||||
return <>
|
||||
<Menu model={items} popup ref={menuLeftRef} id="topBar_profileMenu" className="topBar__menuProfile"/>
|
||||
|
||||
Reference in New Issue
Block a user