@@ -23,8 +23,9 @@ import { type CSSProperties, useEffect, useMemo, useRef } from "react";
2323import { Panel , PanelGroup , PanelResizeHandle } from "react-resizable-panels" ;
2424import * as DoDrawer from "../../reducers/drawer" ;
2525import * as DoExplorer from "../../reducers/explorer" ;
26+ import * as DoFeed from "../../reducers/feed" ;
2627import * as DoUser from "../../reducers/user" ;
27- import useDownload , { useAppSelector } from "../../store/hooks" ;
28+ import useDownload from "../../store/hooks" ;
2829import { notification } from "../Antd" ;
2930import { ClipboardCopyContainer } from "../Common" ;
3031import { DrawerActionButton } from "../Feeds/DrawerUtils" ;
@@ -49,6 +50,7 @@ import type { FilesPayload } from "./types";
4950type TDoDrawer = ThunkModuleToFunc < typeof DoDrawer > ;
5051type TDoUser = ThunkModuleToFunc < typeof DoUser > ;
5152type TDoExplorer = ThunkModuleToFunc < typeof DoExplorer > ;
53+ type TDoFeed = ThunkModuleToFunc < typeof DoFeed > ;
5254
5355const previewAnimation = [ { opacity : "0.0" } , { opacity : "1.0" } ] ;
5456
@@ -77,6 +79,7 @@ type Props = {
7779 useDrawer : UseThunk < DoDrawer . State , TDoDrawer > ;
7880 useUser : UseThunk < DoUser . State , TDoUser > ;
7981 useExplorer : UseThunk < DoExplorer . State , TDoExplorer > ;
82+ useFeed : UseThunk < DoFeed . State , TDoFeed > ;
8083} ;
8184
8285export default ( props : Props ) => {
@@ -94,6 +97,7 @@ export default (props: Props) => {
9497 useDrawer,
9598 useUser,
9699 useExplorer,
100+ useFeed,
97101 } = props ;
98102
99103 const [ classStateUser , _ ] = useUser ;
@@ -109,7 +113,10 @@ export default (props: Props) => {
109113 const explorer = getState ( classStateExplorer ) || DoExplorer . defaultState ;
110114 const { selectedFile } = explorer ;
111115
112- const feed = useAppSelector ( ( state ) => state . feed . currentFeed . data ) ;
116+ const [ classStateFeed , _2 ] = useFeed ;
117+ const feedState = getState ( classStateFeed ) || DoFeed . defaultState ;
118+ const { data : feed } = feedState ;
119+
113120 const handleDownloadMutation = useDownload ( feed ) ;
114121 const [ api , contextHolder ] = notification . useNotification ( ) ;
115122 const { isSuccess, isError, error : downloadError } = handleDownloadMutation ;
0 commit comments