Client - fix user header

This commit is contained in:
Sam 2022-03-13 16:46:16 +01:00
parent d11ce9615a
commit b0334c87da

View File

@ -16,10 +16,10 @@
unitFrom="km" unitFrom="km"
:digits="0" :digits="0"
:displayUnit="false" :displayUnit="false"
:useImperialUnits="user.imperial_units" :useImperialUnits="authUser.imperial_units"
/> />
<span class="stat-label"> <span class="stat-label">
{{ user.imperial_units ? 'miles' : 'km' }} {{ authUser.imperial_units ? 'miles' : 'km' }}
</span> </span>
</div> </div>
<div class="user-stat hide-small"> <div class="user-stat hide-small">
@ -34,10 +34,12 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { toRefs } from 'vue' import { computed, ComputedRef, toRefs } from 'vue'
import UserPicture from '@/components/User/UserPicture.vue' import UserPicture from '@/components/User/UserPicture.vue'
import { IUserProfile } from '@/types/user' import { AUTH_USER_STORE } from '@/store/constants'
import { IAuthUserProfile, IUserProfile } from '@/types/user'
import { useStore } from '@/use/useStore'
interface Props { interface Props {
user: IUserProfile user: IUserProfile
@ -45,6 +47,12 @@
const props = defineProps<Props>() const props = defineProps<Props>()
const { user } = toRefs(props) const { user } = toRefs(props)
const store = useStore()
const authUser: ComputedRef<IAuthUserProfile> = computed(
() => store.getters[AUTH_USER_STORE.GETTERS.AUTH_USER_PROFILE]
)
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>