Created
May 25, 2023 14:38
-
-
Save timohausmann/8e5d90a9c1d126a5a110901cc6eddb86 to your computer and use it in GitHub Desktop.
theatre.ts isStudioHidden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type { IStudio } from '@theatre/studio'; | |
export const theatre = { isInit: false }; | |
export const studioHelper = { | |
isStudioHidden: (): boolean => { | |
if (process.env.NEXT_PUBLIC_VERCEL_ENV === 'production') { | |
return true; | |
} else if(theatre.isInit) { | |
const isHidden = (require('@theatre/studio').default as IStudio).ui.isHidden; | |
return isHidden; | |
} else { | |
return false; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment