Skip to content

Commit cfe8f9f

Browse files
committed
feat: added a different set of default views for Android devices
1 parent bce7235 commit cfe8f9f

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

src/store/modules/views.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const defaultViews = [
1+
const desktopViews = [
22
{
33
id: 'summary',
44
name: 'Summary',
@@ -38,6 +38,23 @@ const defaultViews = [
3838
},
3939
];
4040

41+
const androidViews = [
42+
{
43+
id: 'summary',
44+
name: 'Summary',
45+
elements: [
46+
{ type: 'top_apps', size: 3 },
47+
{ type: 'top_categories', size: 3 },
48+
{ type: 'timeline_barchart', size: 3 },
49+
{ type: 'category_tree', size: 3 },
50+
{ type: 'category_sunburst', size: 3 },
51+
],
52+
},
53+
];
54+
55+
// FIXME: Decide depending on what kind of device is being viewed, not from which device it is being viewed.
56+
const defaultViews = !process.env.VUE_APP_ON_ANDROID ? desktopViews : androidViews;
57+
4158
// initial state
4259
const _state = {
4360
views: [],
@@ -80,7 +97,6 @@ const mutations = {
8097
},
8198
removeView(state, { view_id }) {
8299
const idx = state.views.map(v => v.id).indexOf(view_id);
83-
console.log(idx);
84100
state.views.splice(idx, 1);
85101
},
86102
editView(state, { view_id, el_id, type }) {

0 commit comments

Comments
 (0)