Fix default url not redirecting in studio page (#4592)

This commit is contained in:
WithoutPants 2024-02-20 09:02:52 +11:00 committed by GitHub
parent f5a42ede2d
commit 777fb44ac6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -67,8 +67,6 @@ const validTabs = [
] as const;
type TabKey = (typeof validTabs)[number];
const defaultTab: TabKey = "default";
function isTabKey(tab: string): tab is TabKey {
return validTabs.includes(tab as TabKey);
}
@ -151,7 +149,7 @@ const StudioPage: React.FC<IProps> = ({ studio, tabKey }) => {
);
useEffect(() => {
if (tabKey === defaultTab) {
if (!tabKey) {
setTabKey(populatedDefaultTab);
}
}, [setTabKey, populatedDefaultTab, tabKey]);