mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-18 06:47:02 +08:00
refactor: environment setup (#2898)
Co-authored-by: Simon He <57086651+Simon-He95@users.noreply.github.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { isBrowser } from '@affine/env/constant';
|
||||
import type { EmbedBlockDoubleClickData } from '@blocksuite/blocks';
|
||||
import { atom } from 'jotai';
|
||||
|
||||
@@ -5,7 +6,7 @@ export const previewBlockIdAtom = atom<string | null>(null);
|
||||
export const hasAnimationPlayedAtom = atom<boolean | null>(true);
|
||||
|
||||
previewBlockIdAtom.onMount = set => {
|
||||
if (typeof window !== 'undefined') {
|
||||
if (isBrowser) {
|
||||
const callback = (event: CustomEvent<EmbedBlockDoubleClickData>) => {
|
||||
set(event.detail.blockId);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user