Skip to content

Commit

Permalink
fix: #1925 Workspace Login when no team available
Browse files Browse the repository at this point in the history
  • Loading branch information
badalkhatri0924 committed Dec 1, 2023
1 parent db4d464 commit bc1adb8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions apps/web/pages/auth/passcode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,10 @@ function WorkSpaceScreen({ form, className }: { form: TAuthenticationPasscode }
);

useEffect(() => {
if (form.workspaces.length === 1 && form.workspaces[0].current_teams.length === 1) {
if (form.workspaces.length === 1) {
setSelectedWorkspace(0);
setSelectedTeam(form.workspaces[0].current_teams[0].team_id);
form.workspaces[0].current_teams.length === 1 &&
setSelectedTeam(form.workspaces[0].current_teams[0].team_id);
setTimeout(() => {
document.getElementById('continue-to-workspace')?.click();
}, 100);
Expand Down Expand Up @@ -331,7 +332,7 @@ function WorkSpaceScreen({ form, className }: { form: TAuthenticationPasscode }
<Button
type="submit"
loading={form.signInWorkspaceLoading}
disabled={form.signInWorkspaceLoading || !selectedTeam}
disabled={form.signInWorkspaceLoading || (!selectedWorkspace && selectedWorkspace !== 0)}
id="continue-to-workspace"
>
{t('common.CONTINUE')}
Expand Down

0 comments on commit bc1adb8

Please sign in to comment.