Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Vue from "vue"
- import SecurityContext from "mmr/security/store"
- import Moment from "moment"
- import Picker from "mmr/adaccount/Picker.vue"
- import Notification from "./notification/Notification.vue"
- import SwitchUser from "mmr/switch-user/SwitchUser.vue"
- import Plans from "mmr/components/plans/Plans.vue"
- import { User } from "mmr/security/types/user"
- export default Vue.extend({
- props: {
- },
- data() {
- return {
- currentUser: null as User | null,
- loadingSwitchCompany: false,
- loadingSwitchUser: false,
- showPlans: false,
- trialRemainingTime: null as any,
- }
- },
- computed: {
- loggedIn() {
- return SecurityContext.getters.isLoggedIn()
- },
- user() {
- return SecurityContext.getters.getUser()
- },
- userName() {
- return this.user.name.split(" ").map(n => n[0]).join("")
- },
- },
- methods: {
- timeAgo(date: string) {
- return Moment(date).fromNow()
- },
- homeRoute() {
- if (this.$route.name === "Home")
- return {
- name: "Home",
- params: this.$route.params,
- }
- return {
- name: "Home",
- }
- },
- async logOut() {
- await SecurityContext.actions.logOut()
- this.$router.push({
- name: "Login",
- })
- },
- showSearchModal() {
- // TODO: Handle modal when it comes back
- // this.headerBus.$emit("header:search:show")
- },
- },
- components: {
- adaccountPicker: Picker,
- Notification,
- SwitchUser,
- Plans,
- },
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement