mirror of
https://github.com/yang991178/fluent-reader.git
synced 2025-01-30 17:15:20 +01:00
fix negative unread counts #216
This commit is contained in:
parent
82a6a2c170
commit
4e842e6420
@ -312,7 +312,8 @@ const markUnreadDone = (item: RSSItem): ItemActionTypes => ({
|
||||
})
|
||||
|
||||
export function markRead(item: RSSItem): AppThunk {
|
||||
return dispatch => {
|
||||
return (dispatch, getState) => {
|
||||
item = getState().items[item._id]
|
||||
if (!item.hasRead) {
|
||||
db.itemsDB
|
||||
.update(db.items)
|
||||
@ -377,7 +378,8 @@ export function markAllRead(
|
||||
}
|
||||
|
||||
export function markUnread(item: RSSItem): AppThunk {
|
||||
return dispatch => {
|
||||
return (dispatch, getState) => {
|
||||
item = getState().items[item._id]
|
||||
if (item.hasRead) {
|
||||
db.itemsDB
|
||||
.update(db.items)
|
||||
|
@ -483,7 +483,7 @@ export function sourceReducer(
|
||||
}
|
||||
case MARK_ALL_READ: {
|
||||
let nextState = { ...state }
|
||||
action.sids.map((sid, i) => {
|
||||
action.sids.forEach((sid) => {
|
||||
nextState[sid] = {
|
||||
...state[sid],
|
||||
unreadCount: action.time ? state[sid].unreadCount : 0,
|
||||
|
Loading…
x
Reference in New Issue
Block a user