mark read when open from iid

This commit is contained in:
刘浩远 2020-07-09 20:12:16 +08:00
parent 37ab1931d5
commit a7e00f5e42
5 changed files with 7 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{
"name": "fluent-reader",
"version": "0.5.1",
"version": "0.6.0",
"description": "A simplistic, modern desktop RSS reader",
"main": "./dist/electron.js",
"scripts": {

View File

@ -11,7 +11,9 @@ if (!process.mas) {
app.quit()
}
}
if (!app.isPackaged) app.setAppUserModelId(process.execPath)
else if (process.platform === "win32") app.setAppUserModelId("me.hyliu.fluentreader")
let restarting = false

View File

@ -4,7 +4,7 @@ import { RSSItem, ItemActionTypes, FETCH_ITEMS, fetchItems } from "./item"
import { ActionStatus, AppThunk, getWindowBreakpoint } from "../utils"
import { INIT_FEEDS, FeedActionTypes, ALL, initFeeds } from "./feed"
import { SourceGroupActionTypes, UPDATE_SOURCE_GROUP, ADD_SOURCE_TO_GROUP, DELETE_SOURCE_GROUP, REMOVE_SOURCE_FROM_GROUP, REORDER_SOURCE_GROUPS } from "./group"
import { PageActionTypes, SELECT_PAGE, PageType, selectAllArticles, showItem } from "./page"
import { PageActionTypes, SELECT_PAGE, PageType, selectAllArticles, showItemFromId } from "./page"
import { getCurrentLocale } from "../settings"
import locales from "../i18n/_locales"
import * as db from "../db"
@ -222,7 +222,7 @@ export function pushNotification(item: RSSItem): AppThunk {
notification.onclick = () => {
if (!getState().app.settings.display) {
window.utils.focus()
dispatch(showItem(null, item))
dispatch(showItemFromId(item._id))
}
}
}

View File

@ -396,7 +396,7 @@ export function itemReducer(
case TOGGLE_HIDDEN: {
return {
...state,
[action.item._id]: applyItemReduction(action.item, action.type)
[action.item._id]: applyItemReduction(state[action.item._id], action.type)
}
}
case MARK_ALL_READ: {

View File

@ -97,6 +97,7 @@ export function showItemFromId(iid: string): AppThunk {
return (dispatch, getState) => {
const state = getState()
const item = state.items[iid]
if (!item.hasRead) dispatch(markRead(item))
if (item) dispatch(showItem(null, item))
}
}