mirror of
https://github.com/HangarMC/Hangar.git
synced 2025-01-12 14:06:14 +08:00
7dc5adf2a8
* 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
22 lines
700 B
TypeScript
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;
|
|
}
|