Show notification if server is updated

This commit is contained in:
Deluan
2021-06-21 13:42:14 -04:00
parent 47bcf719f2
commit 877f01bd38
5 changed files with 19 additions and 11 deletions
+5 -7
View File
@@ -3,17 +3,14 @@ import {
EVENT_SCAN_STATUS,
EVENT_SERVER_START,
} from '../actions'
import config from '../config'
const defaultState = {
const initialState = {
scanStatus: { scanning: false, folderCount: 0, count: 0 },
serverStart: { version: config.version },
}
export const activityReducer = (
previousState = {
scanStatus: defaultState,
},
payload
) => {
export const activityReducer = (previousState = initialState, payload) => {
const { type, data } = payload
switch (type) {
case EVENT_SCAN_STATUS:
@@ -23,6 +20,7 @@ export const activityReducer = (
...previousState,
serverStart: {
startTime: data.startTime && Date.parse(data.startTime),
version: data.version,
},
}
case EVENT_REFRESH_RESOURCE: