persist notification settings so extension remembers whether to send … (#95)

* persist notification settings so extension remembers whether to send push notifications even after closing the browser window
This commit is contained in:
pdimitratos 2018-03-02 11:39:45 -08:00 коммит произвёл GitHub
Родитель 7fec698a2a
Коммит 8504e3e396
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

@ -1,4 +1,7 @@
import { combineReducers } from 'redux'
import { persistReducer } from 'redux-persist'
import storage from 'redux-persist/lib/storage' // default: localStorage if web, AsyncStorage if react-native
import * as notificationActions from 'actions/notificationActions'
const notificationOptionsInitialState = {
@ -59,7 +62,13 @@ export function notificationListReducer (state = notificationListInitialState, a
}
export default combineReducers({
options: notificationOptionsReducer,
options: persistReducer(
{
key: 'notificationOptions',
storage
},
notificationOptionsReducer
),
unreadCount: unreadNotificationCountReducer,
list: notificationListReducer
})