diff --git a/package.json b/package.json index ed65239..752addf 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/src/electron.ts b/src/electron.ts index b5a1f31..21753d5 100644 --- a/src/electron.ts +++ b/src/electron.ts @@ -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 diff --git a/src/scripts/models/app.ts b/src/scripts/models/app.ts index f0421b5..353568e 100644 --- a/src/scripts/models/app.ts +++ b/src/scripts/models/app.ts @@ -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)) } } } diff --git a/src/scripts/models/item.ts b/src/scripts/models/item.ts index 7a6d686..0e6d41e 100644 --- a/src/scripts/models/item.ts +++ b/src/scripts/models/item.ts @@ -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: { diff --git a/src/scripts/models/page.ts b/src/scripts/models/page.ts index 4c5c96a..bd91a45 100644 --- a/src/scripts/models/page.ts +++ b/src/scripts/models/page.ts @@ -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)) } }