From 9467e267e05a8de94a509a0c7926a2cf85f7016d Mon Sep 17 00:00:00 2001 From: Cyrille Bollu Date: Tue, 15 Oct 2019 12:16:38 +0200 Subject: 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 --- src/store/timeline.js | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'src/store') 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 * + * @file Timeline related store + * * @author Julius Härtl * @author Jonas Sulzer * @@ -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 -- cgit v1.2.3