update bootstrapper and startup flow

This commit is contained in:
Matt Hill
2021-06-16 18:02:06 -06:00
committed by Aiden McClelland
parent e5de786cf1
commit 84718792bf
12 changed files with 114 additions and 84 deletions

View File

@@ -19,19 +19,11 @@ export class AuthService {
constructor (
private readonly api: ApiService,
private readonly storage: Storage,
) {
this.storage.create()
}
) { }
async init (): Promise<AuthState> {
async init (): Promise<void> {
const loggedIn = await this.storage.get(StorageKeys.LOGGED_IN_KEY)
if (loggedIn) {
this.authState$.next(AuthState.VERIFIED)
return AuthState.VERIFIED
} else {
this.authState$.next(AuthState.UNVERIFIED)
return AuthState.UNVERIFIED
}
this.authState$.next( loggedIn ? AuthState.VERIFIED : AuthState.UNVERIFIED)
}
watch$ (): Observable<AuthState> {