Skip to content

Commit

Permalink
fix: fixed Score visualization on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Nov 22, 2023
1 parent 0282eec commit d0d3682
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/components/SelectableVisualization.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ div
div(v-if="type == 'vis_timeline' && isSingleDay")
vis-timeline(:buckets="timeline_buckets", :showRowLabels='true', :queriedInterval="timeline_daterange")
div(v-if="type == 'score'")
aw-score(:date="date")
aw-score()
</template>

<style lang="scss">
Expand Down
25 changes: 9 additions & 16 deletions src/stores/activity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,7 @@ export const useActivityStore = defineStore('activity', {
always_active_pattern,
});
const data = await getClient().query(periods, q, { name: 'multidevice', verbose: true });
const data_window = data[0].window;

// Set $color and $score for categories
data_window.cat_events = colorCategories(data_window.cat_events);
data_window.cat_events = scoreCategories(data_window.cat_events);

this.query_window_completed(data_window);
this.query_window_completed(data[0].window);
},

async query_desktop_full({
Expand Down Expand Up @@ -378,15 +372,8 @@ export const useActivityStore = defineStore('activity', {
name: 'fullDesktopQuery',
verbose: true,
});
const data_window = data[0].window;
const data_browser = data[0].browser;

// Set $color and $score for categories
data_window.cat_events = colorCategories(data_window.cat_events);
data_window.cat_events = scoreCategories(data_window.cat_events);

this.query_window_completed(data_window);
this.query_browser_completed(data_browser);
this.query_window_completed(data[0].window);
this.query_browser_completed(data[0].browser);
},

async query_editor({ timeperiod }) {
Expand Down Expand Up @@ -701,6 +688,12 @@ export const useActivityStore = defineStore('activity', {
this: State,
data = { app_events: [], title_events: [], cat_events: [], active_events: [], duration: 0 }
) {
// Set $color and $score for categories
if (data.cat_events) {
data.cat_events = colorCategories(data.cat_events);
data.cat_events = scoreCategories(data.cat_events);
}

this.window.top_apps = data.app_events;
this.window.top_titles = data.title_events;
this.category.top = data.cat_events;
Expand Down
3 changes: 0 additions & 3 deletions src/visualizations/Score.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ import { useActivityStore } from '~/stores/activity';
export default {
name: 'aw-score',
props: {
fields: Array,
},
computed: {
categories_with_score: function () {
// FIXME: Does this get all category time? Or just top ones?
Expand Down

1 comment on commit d0d3682

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are screenshots of this commit:

Screenshots using aw-server v0.12.3b11 (click to expand)

Screenshots using aw-server-rust master (click to expand)

Screenshots using aw-server-rust v0.12.3b11 (click to expand)

Please sign in to comment.