fix(core): use download atom (#3558)
This commit is contained in:
@@ -8,7 +8,7 @@ import { isDesktop } from '@affine/env/constant';
|
|||||||
import { CloseIcon, MinusIcon, RoundedRectangleIcon } from '@blocksuite/icons';
|
import { CloseIcon, MinusIcon, RoundedRectangleIcon } from '@blocksuite/icons';
|
||||||
import type { Page } from '@blocksuite/store';
|
import type { Page } from '@blocksuite/store';
|
||||||
import { headerItemsAtom } from '@toeverything/infra/atom';
|
import { headerItemsAtom } from '@toeverything/infra/atom';
|
||||||
import { useAtomValue } from 'jotai';
|
import { useAtom, useAtomValue } from 'jotai';
|
||||||
import type { FC, HTMLAttributes, PropsWithChildren, ReactNode } from 'react';
|
import type { FC, HTMLAttributes, PropsWithChildren, ReactNode } from 'react';
|
||||||
import {
|
import {
|
||||||
forwardRef,
|
forwardRef,
|
||||||
@@ -19,6 +19,7 @@ import {
|
|||||||
useState,
|
useState,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
|
|
||||||
|
import { guideDownloadClientTipAtom } from '../../../atoms/guide';
|
||||||
import { currentModeAtom } from '../../../atoms/mode';
|
import { currentModeAtom } from '../../../atoms/mode';
|
||||||
import type { AffineOfficialWorkspace } from '../../../shared';
|
import type { AffineOfficialWorkspace } from '../../../shared';
|
||||||
import DownloadClientTip from './download-tips';
|
import DownloadClientTip from './download-tips';
|
||||||
@@ -154,13 +155,9 @@ export const Header = forwardRef<
|
|||||||
PropsWithChildren<HeaderProps> & HTMLAttributes<HTMLDivElement>
|
PropsWithChildren<HeaderProps> & HTMLAttributes<HTMLDivElement>
|
||||||
>((props, ref) => {
|
>((props, ref) => {
|
||||||
const [showWarning, setShowWarning] = useState(false);
|
const [showWarning, setShowWarning] = useState(false);
|
||||||
const isDownloadTipHide = localStorage.getItem('affine-is-dt-hide');
|
const [showDownloadTip, setShowDownloadTip] = useAtom(
|
||||||
const [showDownloadTip, setShowDownloadTip] = useState(
|
guideDownloadClientTipAtom
|
||||||
isDownloadTipHide ? false : true
|
|
||||||
);
|
);
|
||||||
// const [shouldShowGuideDownloadClientTip] = useAtom(
|
|
||||||
// guideDownloadClientTipAtom
|
|
||||||
// );
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setShowWarning(shouldShowWarning());
|
setShowWarning(shouldShowWarning());
|
||||||
}, []);
|
}, []);
|
||||||
|
|||||||
Reference in New Issue
Block a user