mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 14:20:31 +00:00
fix: View.
This commit is contained in:
@@ -38,23 +38,8 @@ function AccountsViewsTabs({
|
||||
const { custom_view_id: customViewId = null } = useParams();
|
||||
|
||||
useEffect(() => {
|
||||
changeAccountsCurrentView(customViewId || -1);
|
||||
setTopbarEditView(customViewId);
|
||||
changePageSubtitle(customViewId && viewItem ? viewItem.name : '');
|
||||
|
||||
addAccountsTableQueries({
|
||||
custom_view_id: customViewId,
|
||||
});
|
||||
|
||||
return () => {
|
||||
setTopbarEditView(null);
|
||||
changePageSubtitle('');
|
||||
changeAccountsCurrentView(null);
|
||||
};
|
||||
}, [customViewId]);
|
||||
|
||||
useUpdateEffect(() => {
|
||||
onViewChanged && onViewChanged(customViewId);
|
||||
}, [customViewId]);
|
||||
|
||||
// Handle click a new view tab.
|
||||
@@ -63,6 +48,13 @@ function AccountsViewsTabs({
|
||||
history.push('/custom_views/accounts/new');
|
||||
};
|
||||
|
||||
const handleTabChange = (viewId) => {
|
||||
changeAccountsCurrentView(viewId || -1);
|
||||
// addAccountsTableQueries({
|
||||
// custom_view_id: viewId || null,
|
||||
// });
|
||||
};
|
||||
|
||||
const tabs = accountsViews.map((view) => ({
|
||||
...pick(view, ['name', 'id']),
|
||||
}));
|
||||
@@ -72,6 +64,7 @@ function AccountsViewsTabs({
|
||||
<DashboardViewsTabs
|
||||
initialViewId={customViewId}
|
||||
resourceName={'accounts'}
|
||||
onChange={handleTabChange}
|
||||
tabs={tabs}
|
||||
/>
|
||||
</NavbarGroup>
|
||||
|
||||
Reference in New Issue
Block a user