From d5643d82ab8c8160e205970ca346bfba8a7ad947 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Julius=20H=C3=A4rtl?= <jus@bitgrid.net>
Date: Wed, 10 Oct 2018 09:46:26 +0200
Subject: Add vuex structure
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Julius Härtl <jus@bitgrid.net>
---
 src/App.vue | 33 ++++++++++++++++++---------------
 1 file changed, 18 insertions(+), 15 deletions(-)

(limited to 'src/App.vue')

diff --git a/src/App.vue b/src/App.vue
index d97b47a3..984a0d0f 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -97,26 +97,29 @@
 
 			};
 		},
+		beforeMount: function() {
+			let example = {
+				message: 'Want to #DropDropbox? #DeleteGoogle? #decentralize? We got you covered, easy as a piece of 🥞\n' +
+					'\n' +
+					'Get started right now: https://nextcloud.com/signup',
+				author: 'Nextcloud 📱☁️💻',
+				authorId: '@nextcloud@mastodon.xyz',
+				authorAvatar: OC.linkTo('social', 'img/nextcloud.png'),
+				timestamp: '1 day ago'
+			};
+			let data = [];
+			for (let i=0; i<20; i++) {
+				example.id = Math.floor((Math.random() * 100));
+				data.push(example);
+			}
+			this.$store.commit('addToTimeline', data);
+		},
 		computed: {
 			socialId: function() {
 				return '@' + OC.getCurrentUser().uid + '@' + OC.getHost();
 			},
 			timeline: function() {
-				let example = {
-					message: 'Want to #DropDropbox? #DeleteGoogle? #decentralize? We got you covered, easy as a piece of 🥞\n' +
-						'\n' +
-						'Get started right now: https://nextcloud.com/signup',
-					author: 'Nextcloud 📱☁️💻',
-					authorId: '@nextcloud@mastodon.xyz',
-					authorAvatar: OC.linkTo('social', 'img/nextcloud.png'),
-					timestamp: '1 day ago'
-				};
-				let data = [];
-				for (let i=0; i<20; i++) {
-					example.id = Math.floor((Math.random() * 100));
-					data.push(example);
-				}
-				return data;
+				return this.$store.getters.getTimeline;
 			},
 			menu: function () {
 				let defaultCategories = [
-- 
cgit v1.2.3

