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:
parent
d9feff085a
commit
e90f8b6888
3 changed files with 14 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue