Trigger a UI refresh when the scanner finds changes.

Closes #1025
This commit is contained in:
Deluan
2021-06-09 21:02:20 -04:00
parent cb6aa49439
commit 7f85ecd515
14 changed files with 110 additions and 41 deletions
+13 -1
View File
@@ -1,4 +1,8 @@
import { EVENT_SCAN_STATUS, EVENT_SERVER_START } from '../actions'
import {
EVENT_REFRESH_RESOURCE,
EVENT_SCAN_STATUS,
EVENT_SERVER_START,
} from '../actions'
const defaultState = {
scanStatus: { scanning: false, folderCount: 0, count: 0 },
@@ -21,6 +25,14 @@ export const activityReducer = (
startTime: data.startTime && Date.parse(data.startTime),
},
}
case EVENT_REFRESH_RESOURCE:
return {
...previousState,
refresh: {
lastTime: Date.now(),
resource: data.resource,
},
}
default:
return previousState
}