Skip to content

Commit

Permalink
feat: added a different set of default views for Android devices
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Jan 6, 2021
1 parent bce7235 commit cfe8f9f
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/store/modules/views.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const defaultViews = [
const desktopViews = [
{
id: 'summary',
name: 'Summary',
Expand Down Expand Up @@ -38,6 +38,23 @@ const defaultViews = [
},
];

const androidViews = [
{
id: 'summary',
name: 'Summary',
elements: [
{ type: 'top_apps', size: 3 },
{ type: 'top_categories', size: 3 },
{ type: 'timeline_barchart', size: 3 },
{ type: 'category_tree', size: 3 },
{ type: 'category_sunburst', size: 3 },
],
},
];

// FIXME: Decide depending on what kind of device is being viewed, not from which device it is being viewed.
const defaultViews = !process.env.VUE_APP_ON_ANDROID ? desktopViews : androidViews;

// initial state
const _state = {
views: [],
Expand Down Expand Up @@ -80,7 +97,6 @@ const mutations = {
},
removeView(state, { view_id }) {
const idx = state.views.map(v => v.id).indexOf(view_id);
console.log(idx);
state.views.splice(idx, 1);
},
editView(state, { view_id, el_id, type }) {
Expand Down

0 comments on commit cfe8f9f

Please sign in to comment.