Hangar/frontend/components/mixins/base.ts
Jake Potrebic 7dc5adf2a8
couple fixes
* the most annoying issue surrounding hot reloads during dev
* HangarDecisionVoter was re-using the same eval context for SpEL expressions
* simplified project settings initialization
* perm api didn't work with no auth
2021-04-07 21:58:49 -07:00

22 lines
700 B
TypeScript

import { Component, State, Vue } from 'nuxt-property-decorator';
import { HangarUser } from 'hangar-internal';
import { AuthState } from '~/store/auth';
import { RootState } from '~/store';
@Component
export class HangarComponent extends Vue {
@State((state: AuthState) => state.user, { namespace: 'auth' })
currentUser!: HangarUser | null;
@State((state: RootState) => state.validations)
validations!: RootState['validations'];
@State((state: AuthState) => state.authenticated, { namespace: 'auth' })
isLoggedIn!: boolean;
}
export class Authed extends HangarComponent {
@State((state: AuthState) => state.user, { namespace: 'auth' })
currentUser!: HangarUser;
}