1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

fixed auth hydration

This commit is contained in:
Fedor Katurov 2022-01-09 19:32:37 +07:00
parent d9feff085a
commit e90f8b6888
3 changed files with 14 additions and 3 deletions

View file

@ -1,7 +1,7 @@
import { IUser } from '~/types/auth';
import { EMPTY_USER } from '~/constants/auth';
import { makeAutoObservable } from 'mobx';
import { makePersistable } from 'mobx-persist-store';
import { makePersistable, isHydrated } from 'mobx-persist-store';
export class AuthStore {
token: string = '';
@ -18,6 +18,10 @@ export class AuthStore {
});
}
get isHydrated() {
return isHydrated(this);
}
get isUser() {
return !!this.token;
}