Skip to content

Commit

Permalink
fix: fix error toast popping up in Workpace Creator view (#9855)
Browse files Browse the repository at this point in the history
(cherry picked from commit 6e08303)
  • Loading branch information
salonig23 authored and corban-beaird committed Aug 23, 2024
1 parent bd33228 commit 9494823
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions webui/react/src/components/WorkspaceCreateModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ const WorkspaceCreateModalComponent: React.FC<Props> = ({ onClose, workspaceId }
const resourceManagers = Loadable.getOrElse([], loadableResourceManagers);
const namespaceBindingsList = useAsync(
async (canceller) => {
if (workspaceId === undefined || resourceManagers.length === 0) {
if (
workspaceId === undefined ||
resourceManagers.length === 0 ||
!canSetWorkspaceNamespaceBindings
) {
return NotLoaded;
}
try {
Expand All @@ -95,11 +99,11 @@ const WorkspaceCreateModalComponent: React.FC<Props> = ({ onClose, workspaceId }
return NotLoaded;
}
},
[resourceManagers, workspaceId],
[canSetWorkspaceNamespaceBindings, resourceManagers, workspaceId],
);
const resourceQuotasList = useAsync(
async (canceller) => {
if (workspaceId === undefined || resourceManagers.length === 0) {
if (workspaceId === undefined || resourceManagers.length === 0 || !canViewResourceQuotas) {
return NotLoaded;
}
try {
Expand All @@ -118,7 +122,7 @@ const WorkspaceCreateModalComponent: React.FC<Props> = ({ onClose, workspaceId }
return NotLoaded;
}
},
[resourceManagers, workspaceId],
[canViewResourceQuotas, resourceManagers, workspaceId],
);

const initFields = useCallback(
Expand Down

0 comments on commit 9494823

Please # to comment.