summaryrefslogtreecommitdiffstats
path: root/src/store
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2019-01-11 09:36:49 +0100
committerMaxence Lange <maxence@artificial-owl.com>2019-02-05 15:25:20 -0100
commit9c6c164b895483f86fa03772b6cba9f0e440fc89 (patch)
tree585de5cf29519b10f58cb2c02f72b75cf276c6d4 /src/store
parent8c0c0bc5a3f20f86002be8cab6030f5cfab8af12 (diff)
Add search and timeline for hashtags
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'src/store')
-rw-r--r--src/store/timeline.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/store/timeline.js b/src/store/timeline.js
index e816f41d..be1ca66c 100644
--- a/src/store/timeline.js
+++ b/src/store/timeline.js
@@ -27,6 +27,7 @@ const state = {
timeline: {},
since: Math.floor(Date.now() / 1000) + 1,
type: 'home',
+ params: {},
account: ''
}
const mutations = {
@@ -43,6 +44,9 @@ const mutations = {
setTimelineType(state, type) {
state.type = type
},
+ setTimelineParams(state, params) {
+ state.params = params
+ },
setAccount(state, account) {
state.account = account
}
@@ -55,9 +59,10 @@ const getters = {
}
}
const actions = {
- changeTimelineType(context, type) {
+ changeTimelineType(context, { type, params }) {
context.commit('resetTimeline')
context.commit('setTimelineType', type)
+ context.commit('setTimelineParams', params)
context.commit('setAccount', '')
},
changeTimelineTypeAccount(context, account) {
@@ -88,6 +93,8 @@ const actions = {
let url
if (state.type === 'account') {
url = OC.generateUrl(`apps/social/api/v1/account/${state.account}/stream?limit=25&since=` + sinceTimestamp)
+ } else if (state.type === 'tags') {
+ url = OC.generateUrl(`apps/social/api/v1/stream/tag/${state.params.tag}?limit=25&since=` + sinceTimestamp)
} else {
url = OC.generateUrl(`apps/social/api/v1/stream/${state.type}?limit=25&since=` + sinceTimestamp)
}