Skip to content

Commit

Permalink
fix: readded active history caching
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Apr 28, 2020
1 parent f90c0af commit 035d4cc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/store/modules/activity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,12 @@ const mutations = {
state.active.duration = null;
state.active.events = null;

state.active.history = {};
// Ensures that active history isn't being fully reloaded on every date change
// (see caching done in query_active_history and query_active_history_android)
// FIXME: Better detection of when to actually clear (such as on force reload, hostname change)
if (Object.keys(state.active.history).length === 0) {
state.active.history = {};
}
},

set_available(state, data) {
Expand Down

0 comments on commit 035d4cc

Please sign in to comment.