Skip to content

[dashboard] fix workspace start stuck in checking during ide onboarding #9979

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

Merged
merged 1 commit into from
May 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions components/dashboard/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ function App() {

const [loading, setLoading] = useState<boolean>(true);
const [isWhatsNewShown, setWhatsNewShown] = useState(false);
const [showUserIdePreference, setShowUserIdePreference] = useState(false);
const [isSetupRequired, setSetupRequired] = useState(false);
const history = useHistory();

Expand Down Expand Up @@ -492,16 +493,23 @@ function App() {
// Prefix with `/#referrer` will specify an IDE for workspace
// We don't need to show IDE preference in this case
const shouldUserIdePreferenceShown = User.isOnboardingUser(user) && !hash.startsWith(ContextURL.REFERRER_PREFIX);
if (shouldUserIdePreferenceShown !== showUserIdePreference) {
setShowUserIdePreference(shouldUserIdePreferenceShown);
}

const isCreation = window.location.pathname === "/" && hash !== "";
const isWsStart = /\/start\/?/.test(window.location.pathname) && hash !== "";
if (isWhatsNewShown) {
toRender = <WhatsNew onClose={() => setWhatsNewShown(false)} />;
} else if (isCreation) {
if (shouldUserIdePreferenceShown) {
if (showUserIdePreference) {
toRender = (
<StartPage phase={StartPhase.Checking}>
<SelectIDEModal />
<SelectIDEModal
onClose={() => {
setShowUserIdePreference(false);
}}
/>
</StartPage>
);
} else {
Expand Down