1b2d48ff22
Reduced time counter increment interval. Added badge service. Refactored user service. Replaced Google+ with People API.
28 lines
587 B
Vue
28 lines
587 B
Vue
<template>
|
|
<span class="user-name">{{name}}</span>
|
|
</template>
|
|
|
|
<script>
|
|
import userSvc from '../services/userSvc';
|
|
import store from '../store';
|
|
|
|
export default {
|
|
props: ['userId'],
|
|
computed: {
|
|
sanitizedUserId() {
|
|
return userSvc.sanitizeUserId(this.userId);
|
|
},
|
|
name() {
|
|
const userInfo = store.state.userInfo.itemsById[this.sanitizedUserId];
|
|
return userInfo ? userInfo.name : 'Someone';
|
|
},
|
|
},
|
|
watch: {
|
|
sanitizedUserId: {
|
|
handler: sanitizedUserId => userSvc.addUserId(sanitizedUserId),
|
|
immediate: true,
|
|
},
|
|
},
|
|
};
|
|
</script>
|