Save author of the status in state

This commit is contained in:
Angelina Filippova 2020-05-19 23:15:22 +03:00
parent 2f0f424f91
commit fd54181805
2 changed files with 8 additions and 2 deletions

View file

@ -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 })
},

View file

@ -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() {