Fix mounting component

This commit is contained in:
Angelina Filippova 2020-05-01 01:24:43 +03:00
parent 005c8ff161
commit 0a4ddd3e6f

View file

@ -1,5 +1,5 @@
<template> <template>
<main> <div v-if="!loading">
<header v-if="isDesktop || isTablet" class="user-page-header"> <header v-if="isDesktop || isTablet" class="user-page-header">
<div class="avatar-name-container"> <div class="avatar-name-container">
<el-avatar v-if="accountExists(user, 'avatar')" :src="user.avatar" size="large" /> <el-avatar v-if="accountExists(user, 'avatar')" :src="user.avatar" size="large" />
@ -29,7 +29,7 @@
<div class="status-container"> <div class="status-container">
<status :status="status" :account="user" :show-checkbox="false" :godmode="showPrivate"/> <status :status="status" :account="user" :show-checkbox="false" :godmode="showPrivate"/>
</div> </div>
</main> </div>
</template> </template>
<script> <script>
@ -56,6 +56,9 @@ export default {
isTablet() { isTablet() {
return this.$store.state.app.device === 'tablet' return this.$store.state.app.device === 'tablet'
}, },
loading() {
return this.$store.state.status.loading
},
status() { status() {
return this.$store.state.status.fetchedStatus return this.$store.state.status.fetchedStatus
}, },
@ -63,7 +66,7 @@ export default {
return this.$store.state.status.fetchedStatus.account return this.$store.state.status.fetchedStatus.account
} }
}, },
mounted: function() { beforeMount: function() {
this.$store.dispatch('NeedReboot') this.$store.dispatch('NeedReboot')
this.$store.dispatch('GetNodeInfo') this.$store.dispatch('GetNodeInfo')
this.$store.dispatch('FetchStatus', this.$route.params.id) this.$store.dispatch('FetchStatus', this.$route.params.id)