summaryrefslogtreecommitdiffstats
path: root/src/store
diff options
context:
space:
mode:
authorCyrille Bollu <cyrpub@bollu.be>2019-10-15 12:16:38 +0200
committerRobin Appelman <robin@icewind.nl>2020-10-13 23:53:37 +0200
commit9467e267e05a8de94a509a0c7926a2cf85f7016d (patch)
treeef88825abe4debc9725656065edd17c8a8312476 /src/store
parent13fdd63efb6f6e737a5a18efbf435625db632fdd (diff)
ENHANCEMENT: Adds a composer to the single post timeline.
This composer is hidden by default and will only show when some authenticated user clicks on the 'reply' icon of a post. Signed-off-by: Cyrille Bollu <cyrpub@bollu.be>
Diffstat (limited to 'src/store')
-rw-r--r--src/store/timeline.js28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/store/timeline.js b/src/store/timeline.js
index 968e2e68..0bb4aa01 100644
--- a/src/store/timeline.js
+++ b/src/store/timeline.js
@@ -1,6 +1,8 @@
/*
* @copyright Copyright (c) 2018 Julius Härtl <jus@bitgrid.net>
*
+ * @file Timeline related store
+ *
* @author Julius Härtl <jus@bitgrid.net>
* @author Jonas Sulzer <jonas@violoncello.ch>
*
@@ -26,12 +28,30 @@ import axios from '@nextcloud/axios'
import Vue from 'vue'
import { generateUrl } from '@nextcloud/router'
+/**
+ * @property {object} timeline - The posts' collection
+ * @property {int} since - Time (EPOCH) of the most recent post
+ * @property {string} type - Timeline's type: 'home', 'single-post',...
+ * @property {object} params - Timeline's parameters
+ * @property {string} account -
+ */
const state = {
timeline: {},
since: Math.floor(Date.now() / 1000) + 1,
type: 'home',
+ /**
+ * @namespace params
+ * @property {string} account ???
+ * @property {string} id
+ * @property {string} localId
+ * @property {string} type ???
+ */
params: {},
- account: ''
+ account: '',
+ /* Tells whether the composer should be displayed or not
+ * @member {boolean}
+ */
+ composerDisplayStatus: false
}
const mutations = {
addToTimeline(state, data) {
@@ -53,6 +73,9 @@ const mutations = {
setTimelineParams(state, params) {
state.params = params
},
+ setComposerDisplayStatus(state, status) {
+ state.composerDisplayStatus = status
+ },
setAccount(state, account) {
state.account = account
},
@@ -90,6 +113,9 @@ const mutations = {
}
}
const getters = {
+ getComposerDisplayStatus(state) {
+ return state.composerDisplayStatus
+ },
getTimeline(state) {
return Object.values(state.timeline).sort(function(a, b) {
return b.publishedTime - a.publishedTime