Skip to content
Snippets Groups Projects
Commit fd541818 authored by Angelina Filippova's avatar Angelina Filippova
Browse files

Save author of the status in state

parent 2f0f424f
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@ const status = {
fetchedStatus: {},
fetchedStatuses: [],
loading: false,
statusAuthor: {},
statusesByInstance: {
selectedInstance: '',
showLocal: false,
......@@ -49,6 +50,9 @@ const status = {
},
SET_STATUS_VISIBILITY: (state, visibility) => {
state.statusVisibility = visibility
},
SET_STATUS_AUTHOR: (state, user) => {
state.statusAuthor = user
}
},
actions: {
......@@ -77,6 +81,7 @@ const status = {
const status = await fetchStatus(id, getters.authHost, getters.token)
commit('SET_STATUS', status.data)
commit('SET_STATUS_AUTHOR', status.data.account)
commit('SET_LOADING', false)
dispatch('FetchUserStatuses', { userId: state.fetchedStatus.account.id, godmode: false })
},
......
......@@ -8,7 +8,8 @@
<div class="left-header-container">
<moderation-dropdown
:user="user"
:page="'userPage'"
:page="'statusPage'"
:status-id="status.id"
@open-reset-token-dialog="openResetPasswordDialog"/>
<reboot-button/>
</div>
......@@ -81,7 +82,7 @@ export default {
return this.$store.state.userProfile.statusesLoading
},
user() {
return this.$store.state.status.fetchedStatus.account
return this.$store.state.status.statusAuthor
}
},
beforeMount: function() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment