diff --git a/packages/frontend/core/src/components/pure/ai-island/index.tsx b/packages/frontend/core/src/components/pure/ai-island/index.tsx index e5517f8ef255a..485a543e69eb2 100644 --- a/packages/frontend/core/src/components/pure/ai-island/index.tsx +++ b/packages/frontend/core/src/components/pure/ai-island/index.tsx @@ -13,7 +13,11 @@ import { borderAngle3, } from './styles.css'; -if (typeof window !== 'undefined' && window.CSS) { +if ( + typeof window !== 'undefined' && + window.CSS && + window.CSS.registerProperty +) { const getName = (nameWithVar: string) => nameWithVar.slice(4, -1); const registerAngle = (varName: string, initialValue: number) => { window.CSS.registerProperty({ diff --git a/packages/frontend/core/src/modules/peek-view/view/modal-container.tsx b/packages/frontend/core/src/modules/peek-view/view/modal-container.tsx index d8d4b063a8a65..ec036d89e8f49 100644 --- a/packages/frontend/core/src/modules/peek-view/view/modal-container.tsx +++ b/packages/frontend/core/src/modules/peek-view/view/modal-container.tsx @@ -103,11 +103,15 @@ export const PeekViewModalContainer = forwardRef< ) { const [vtOpen, setVtOpen] = useState(open); useEffect(() => { - document.startViewTransition(() => { - flushSync(() => { - setVtOpen(open); + if (document.startViewTransition) { + document.startViewTransition(() => { + flushSync(() => { + setVtOpen(open); + }); }); - }); + } else { + setVtOpen(open); + } }, [open]); useEffect(() => {