interface: reduce %saw-place correctly

This commit is contained in:
Liam Fitzgerald 2021-10-01 13:38:26 +10:00
parent 841df9cfe4
commit c80806c062

View File

@ -109,7 +109,8 @@ function updateNotificationStats(state: HarkState, place: HarkPlace, f: (s: Hark
function seenIndex(json: any, state: HarkState): HarkState {
const data = _.get(json, 'saw-place');
if(data) {
updateNotificationStats(state, data, s => ({ last: Date.now() }));
const last = data?.time || Date.now();
updateNotificationStats(state, data.place, s => ({ last }));
}
return state;
}