Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1840355: fix useCloudShellWorkspace effect re-entry when searching projects #5625

Merged
merged 1 commit into from
May 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,18 @@ const useCloudShellWorkspace = (
const workspace = findWorkspace(data);

const searchNamespaces =
// wait for access review to return
!loadingAccessReview &&
// user cannot list workspaces at the cluster scope
!canListWorkspaces &&
// fetching the workspace succeeded or failed
(loaded || loadError) &&
// was a workspace was found
!workspace &&
// did a previous search result in no namespace found
!noNamespaceFound &&
// are we currently searching
!searching;
searching ||
// wait for access review to return
(!loadingAccessReview &&
// user cannot list workspaces at the cluster scope
!canListWorkspaces &&
// fetching the workspace succeeded or failed
(loaded || loadError) &&
// was a workspace was found
!workspace &&
// did a previous search result in no namespace found
!noNamespaceFound);

// FIXME need to use a service account on the backend to find the workspace instead of inefficiently looping through namespaces
React.useEffect(() => {
Expand Down