Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(core): use download atom (#3558)

Alex Yang33cc9d25a1ba
diff --git a/apps/core/src/components/blocksuite/workspace-header/header.tsx b/apps/core/src/components/blocksuite/workspace-header/header.tsx
index 63327bacc7..a9fbfc9c38 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<HeaderProps> & HTMLAttributes<HTMLDivElement>
>((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());
}, []);