refactor: add ViewBar and move view components to ui/view-bar (#1495)

Closes #1494
This commit is contained in:
Thaïs
2023-09-08 11:57:16 +02:00
committed by GitHub
parent ccb57c91a3
commit df17da80fc
22 changed files with 325 additions and 376 deletions

View File

@ -113,7 +113,8 @@ export const useViews = ({
const viewToCreate = nextViews.find((nextView) => !viewsById[nextView.id]);
if (viewToCreate) {
await createView(viewToCreate);
return refetch();
await refetch();
return;
}
const viewToUpdate = nextViews.find(
@ -122,7 +123,8 @@ export const useViews = ({
);
if (viewToUpdate) {
await updateView(viewToUpdate);
return refetch();
await refetch();
return;
}
const nextViewIds = nextViews.map((nextView) => nextView.id);
@ -131,7 +133,7 @@ export const useViews = ({
);
if (viewIdToDelete) await deleteView(viewIdToDelete);
return refetch();
await refetch();
};
return { handleViewsChange, isFetchingViews: loading };