Skip to content
This repository has been archived by the owner on Oct 19, 2022. It is now read-only.

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank Gregor committed May 25, 2020
1 parent 5bba379 commit 5f49ff0
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions lib/src/main/main_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,24 +123,28 @@ class MainBloc extends Bloc<MainEvent, MainState> {
yield MainStateFailure(error: error.toString());
}
} else if (event is AppLoaded) {
final bool configured = await _context.isConfigured();
if (configured) {
await _setupLoggedInAppState();
}
try {
final bool configured = await _context.isConfigured();
if (configured) {
await _setupLoggedInAppState();
}

final needsOnboarding = Customer.needsOnboarding;
if (needsOnboarding) {
await Customer().configureOnboardingAsync();
} else {
await setupManagers(event.context);
}
final needsOnboarding = Customer.needsOnboarding;
if (needsOnboarding) {
await Customer().configureOnboardingAsync();
} else {
await setupManagers(event.context);
}

final bool hasAuthenticationError = await _checkForAuthenticationError();
yield MainStateSuccess(
configured: configured,
hasAuthenticationError: hasAuthenticationError,
needsOnboarding: needsOnboarding
);
final bool hasAuthenticationError = await _checkForAuthenticationError();
yield MainStateSuccess(
configured: configured,
hasAuthenticationError: hasAuthenticationError,
needsOnboarding: needsOnboarding
);
} catch (error) {
yield MainStateFailure(error: error.toString());
}

} else if (event is Logout) {
await _logout();
Expand Down

0 comments on commit 5f49ff0

Please sign in to comment.