From 33cc9d25a1ba65b1c758101ae31bfa80a30ff51d Mon Sep 17 00:00:00 2001 From: Alex Yang Date: Thu, 3 Aug 2023 10:13:44 -0700 Subject: [PATCH] fix(core): use download atom (#3558) --- .../components/blocksuite/workspace-header/header.tsx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/apps/core/src/components/blocksuite/workspace-header/header.tsx b/apps/core/src/components/blocksuite/workspace-header/header.tsx index 63327bacc..a9fbfc9c3 100644 --- a/apps/core/src/components/blocksuite/workspace-header/header.tsx +++ b/apps/core/src/components/blocksuite/workspace-header/header.tsx @@ -8,7 +8,7 @@ import { isDesktop } from '@affine/env/constant'; import { CloseIcon, MinusIcon, RoundedRectangleIcon } from '@blocksuite/icons'; import type { Page } from '@blocksuite/store'; import { headerItemsAtom } from '@toeverything/infra/atom'; -import { useAtomValue } from 'jotai'; +import { useAtom, useAtomValue } from 'jotai'; import type { FC, HTMLAttributes, PropsWithChildren, ReactNode } from 'react'; import { forwardRef, @@ -19,6 +19,7 @@ import { useState, } from 'react'; +import { guideDownloadClientTipAtom } from '../../../atoms/guide'; import { currentModeAtom } from '../../../atoms/mode'; import type { AffineOfficialWorkspace } from '../../../shared'; import DownloadClientTip from './download-tips'; @@ -154,13 +155,9 @@ export const Header = forwardRef< PropsWithChildren & HTMLAttributes >((props, ref) => { const [showWarning, setShowWarning] = useState(false); - const isDownloadTipHide = localStorage.getItem('affine-is-dt-hide'); - const [showDownloadTip, setShowDownloadTip] = useState( - isDownloadTipHide ? false : true + const [showDownloadTip, setShowDownloadTip] = useAtom( + guideDownloadClientTipAtom ); - // const [shouldShowGuideDownloadClientTip] = useAtom( - // guideDownloadClientTipAtom - // ); useEffect(() => { setShowWarning(shouldShowWarning()); }, []);