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.

feat: should hide downloadtip when it had been closed (#3555)

Chi Zhang2678ca9330e9
diff --git a/apps/core/src/components/blocksuite/workspace-header/header.tsx b/apps/core/src/components/blocksuite/workspace-header/header.tsx
index 7792ca7dce..63327bacc7 100644
--- a/apps/core/src/components/blocksuite/workspace-header/header.tsx
+++ b/apps/core/src/components/blocksuite/workspace-header/header.tsx
@@ -154,7 +154,10 @@ export const Header = forwardRef<
PropsWithChildren<HeaderProps> & HTMLAttributes<HTMLDivElement>
>((props, ref) => {
const [showWarning, setShowWarning] = useState(false);
- const [showDownloadTip, setShowDownloadTip] = useState(true);
+ const isDownloadTipHide = localStorage.getItem('affine-is-dt-hide');
+ const [showDownloadTip, setShowDownloadTip] = useState(
+ isDownloadTipHide ? false : true
+ );
// const [shouldShowGuideDownloadClientTip] = useAtom(
// guideDownloadClientTipAtom
// );
@@ -177,7 +180,10 @@ export const Header = forwardRef<
{showDownloadTip ? (
<DownloadClientTip
show={showDownloadTip}
- onClose={() => setShowDownloadTip(false)}
+ onClose={() => {
+ setShowDownloadTip(false);
+ localStorage.setItem('affine-is-dt-hide', '1');
+ }}
/>
) : (
<BrowserWarning