addApp method

  1. @override
Future<LoggedOut> addApp(
  1. AccessBloc accessBloc,
  2. AppModel newCurrentApp
)
override

Implementation

@override
Future<LoggedOut> addApp(
    AccessBloc accessBloc, AppModel newCurrentApp) async {
  bool found = false;
  for (var determinedApp in apps) {
    if (determinedApp.app.documentID == newCurrentApp.documentID) {
      found = true;
      break;
    }
  }

  if (found) {
    return LoggedOut._(apps, accesses,
        playstoreApp: playstoreApp,
        isProcessing: isProcessing,
        newForceRefresh: forceRefresh);
  } else {
    return addApp2(accessBloc, accesses, apps, newCurrentApp);
  }
}