perf: getEnvironment() -> env (#2636)

This commit is contained in:
Simon He
2023-06-01 11:23:38 +08:00
committed by GitHub
parent e1314730be
commit fc9462eee9
16 changed files with 70 additions and 86 deletions
@@ -1,4 +1,4 @@
import { getEnvironment } from '@affine/env';
import { env } from '@affine/env';
import { Skeleton } from '@mui/material';
import { assignInlineVars } from '@vanilla-extract/dynamic';
import { useAtom, useAtomValue } from 'jotai';
@@ -79,8 +79,7 @@ export function AppSidebar(props: AppSidebarProps): ReactElement {
// disable animation to avoid UI flash
const enableAnimation = useEnableAnimation();
const environment = getEnvironment();
const isMacosDesktop = environment.isDesktop && environment.isMacOs;
const isMacosDesktop = env.isDesktop && env.isMacOs;
if (initialRender) {
// avoid the UI flash
return <div />;