Skip to content

Commit 20044d3

Browse files
[dashboard] Prevent that the tab of “New Workspace“ changes when visible
Fixes #3764
1 parent b87595a commit 20044d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/dashboard/src/workspaces/StartWorkspaceModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type Mode = 'Recent' | 'Examples';
2727
export function StartWorkspaceModal(p: StartWorkspaceModalProps) {
2828
const computeSelection = () => p.selected || (p.recent.length > 0 ? 'Recent' : 'Examples');
2929
const [selection, setSelection] = useState(computeSelection());
30-
useEffect(() => setSelection(computeSelection()), [p.recent, p.selected]);
30+
useEffect(() => { !p.visible && setSelection(computeSelection()) }, [p.visible, p.recent, p.selected]);
3131

3232
const list = (selection === 'Recent' ? p.recent : p.examples).map((e, i) =>
3333
<a key={`item-${i}-${e.title}`} href={e.startUrl} className="rounded-xl group hover:bg-gray-100 dark:hover:bg-gray-800 flex p-4 my-1">

0 commit comments

Comments
 (0)