Skip to content

Commit

Permalink
[dashboard] Prevent that the tab of “New Workspace“ changes when visible
Browse files Browse the repository at this point in the history
  • Loading branch information
corneliusludmann authored and MatthewFagan committed Nov 24, 2021
1 parent 5498ad5 commit 4b8e167
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type Mode = 'Recent' | 'Examples' | 'Link';
export function StartWorkspaceModal(p: StartWorkspaceModalProps) {
const computeSelection = () => p.selected || (p.recent.length > 0 ? 'Recent' : 'Examples');
const [selection, setSelection] = useState(computeSelection());
useEffect(() => setSelection(computeSelection()), [p.recent, p.selected]);
useEffect(() => { !p.visible && setSelection(computeSelection()) }, [p.visible, p.recent, p.selected]);

const [repoUrl, setRepoUrl] = useState("");

Expand Down

0 comments on commit 4b8e167

Please sign in to comment.