Skip to content

Commit

Permalink
[front] skip call if not admin (#7545)
Browse files Browse the repository at this point in the history
* skip call if not admin

* no loading if disabled
  • Loading branch information
tdraier committed Sep 19, 2024
1 parent e833af8 commit 8fd092b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export function EditVaultManagedDataSourcesViews({
workspaceId: owner.sId,
vaultId: systemVault.sId,
category: "managed",
disabled: !isAdmin,
});

const updateVaultDataSourceViews = async (
Expand Down
2 changes: 1 addition & 1 deletion front/lib/swr/vaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export function useVaultDataSourceViews({
vaultDataSourceViews,
mutate,
mutateRegardlessOfQueryParams,
isVaultDataSourceViewsLoading: !error && !data,
isVaultDataSourceViewsLoading: !disabled && !error && !data,
isVaultDataSourceViewsError: error,
};
}
Expand Down

0 comments on commit 8fd092b

Please sign in to comment.