dispatch(closeContextMenu())}>
-
-
-
+
diff --git a/src/components/settings.tsx b/src/components/settings.tsx
index 7119a2d..2a3167c 100644
--- a/src/components/settings.tsx
+++ b/src/components/settings.tsx
@@ -1,14 +1,13 @@
import * as React from "react"
import { Icon } from "@fluentui/react/lib/Icon"
import { AnimationClassNames } from "@fluentui/react/lib/Styling"
-import { SettingsReduxProps } from "../containers/settings-container"
import AboutTab from "./settings/about"
import { Pivot, PivotItem, Spinner } from "@fluentui/react"
import SourcesTabContainer from "../containers/settings/sources-container"
import GroupsTabContainer from "../containers/settings/groups-container"
import ProxyTab from "./settings/proxy"
-type SettingsProps = SettingsReduxProps & {
+type SettingsProps = {
display: boolean,
blocked: boolean,
exitting: boolean,
diff --git a/src/containers/feed-container.tsx b/src/containers/feed-container.tsx
index e5a87f3..8678cc1 100644
--- a/src/containers/feed-container.tsx
+++ b/src/containers/feed-container.tsx
@@ -2,7 +2,7 @@ import { connect } from "react-redux"
import { createSelector } from "reselect"
import { RootState } from "../scripts/reducer"
import CardsFeed from "../components/feeds/cards-feed"
-import { markRead, markUnread } from "../scripts/models/item"
+import { markRead } from "../scripts/models/item"
import { openItemMenu } from "../scripts/models/app"
import { FeedIdType, loadMore } from "../scripts/models/feed"
@@ -12,7 +12,7 @@ interface FeedContainerProps {
const getSources = (state: RootState) => state.sources
const getItems = (state: RootState) => state.items
-const getFeed = (state: RootState) => state.feeds[state.page.feedId]
+const getFeed = (state: RootState, props: FeedContainerProps) => state.feeds[props.feedId]
const makeMapStateToProps = () => {
return createSelector(
diff --git a/src/containers/log-menu-container.tsx b/src/containers/log-menu-container.tsx
index eb08fb3..5c42577 100644
--- a/src/containers/log-menu-container.tsx
+++ b/src/containers/log-menu-container.tsx
@@ -12,6 +12,5 @@ const mapDispatchToProps = dispatch => {
return { close: () => dispatch(toggleLogMenu()) }
}
-const connector = connect(mapStateToProps, mapDispatchToProps)
-export type LogsReduxProps = typeof connector
-export const LogMenuContainer = connector(LogMenu)
\ No newline at end of file
+const LogMenuContainer = connect(mapStateToProps, mapDispatchToProps)(LogMenu)
+export default LogMenuContainer
\ No newline at end of file
diff --git a/src/containers/menu-container.tsx b/src/containers/menu-container.tsx
index 112071a..0217223 100644
--- a/src/containers/menu-container.tsx
+++ b/src/containers/menu-container.tsx
@@ -38,6 +38,5 @@ const mapDispatchToProps = dispatch => ({
}
})
-const connector = connect(mapStateToProps, mapDispatchToProps)
-export type MenuReduxProps = typeof connector
-export const MenuContainer = connector(Menu)
\ No newline at end of file
+const MenuContainer = connect(mapStateToProps, mapDispatchToProps)(Menu)
+export default MenuContainer
\ No newline at end of file
diff --git a/src/containers/nav-container.tsx b/src/containers/nav-container.tsx
index 5005782..8d32a16 100644
--- a/src/containers/nav-container.tsx
+++ b/src/containers/nav-container.tsx
@@ -18,6 +18,5 @@ const mapDispatchToProps = (dispatch) => ({
settings: () => dispatch(toggleSettings())
})
-const connector = connect(mapStateToProps, mapDispatchToProps)
-export type NavReduxProps = typeof connector
-export const NavContainer = connector(Nav)
\ No newline at end of file
+const NavContainer = connect(mapStateToProps, mapDispatchToProps)(Nav)
+export default NavContainer
\ No newline at end of file
diff --git a/src/containers/page-container.tsx b/src/containers/page-container.tsx
new file mode 100644
index 0000000..0d3e6e9
--- /dev/null
+++ b/src/containers/page-container.tsx
@@ -0,0 +1,18 @@
+import { connect } from "react-redux"
+import { createSelector } from "reselect"
+import { RootState } from "../scripts/reducer"
+import Page from "../components/page"
+
+const getFeeds = (state: RootState) => state.page.feedId
+const getSettings = (state: RootState) => state.app.settings.display
+
+const mapStateToProps = createSelector(
+ [getFeeds, getSettings],
+ (feeds, settingsOn) => ({
+ feeds: [feeds],
+ settingsOn: settingsOn
+ })
+)
+
+const PageContainer = connect(mapStateToProps)(Page)
+export default PageContainer
\ No newline at end of file
diff --git a/src/containers/settings-container.tsx b/src/containers/settings-container.tsx
index 7132f38..c4f18ee 100644
--- a/src/containers/settings-container.tsx
+++ b/src/containers/settings-container.tsx
@@ -20,6 +20,5 @@ const mapDispatchToProps = dispatch => {
}
}
-const connector = connect(mapStateToProps, mapDispatchToProps)
-export type SettingsReduxProps = typeof connector
-export const SettingsContainer = connector(Settings)
\ No newline at end of file
+const SettingsContainer = connect(mapStateToProps, mapDispatchToProps)(Settings)
+export default SettingsContainer
\ No newline at end of file
diff --git a/src/scripts/utils.ts b/src/scripts/utils.ts
index 8dd9e8c..8c36cc4 100644
--- a/src/scripts/utils.ts
+++ b/src/scripts/utils.ts
@@ -31,7 +31,7 @@ export function toggleProxyStatus() {
setProxy()
}
export function getProxy() {
- return localStorage.getItem(PAC_STORE_KEY)
+ return localStorage.getItem(PAC_STORE_KEY) || ""
}
export function setProxy(address = null) {
if (!address) {
@@ -44,7 +44,6 @@ export function setProxy(address = null) {
})
}
-
import ElectronProxyAgent = require("@yang991178/electron-proxy-agent")
let agent = new ElectronProxyAgent(remote.getCurrentWebContents().session)
export const rssParser = new Parser({