acceptPoliciesIfNone method

Future<LoggedIn> acceptPoliciesIfNone(
  1. LoggedIn toEmit,
  2. AppModel app,
  3. MemberModel member
)

Implementation

Future<LoggedIn> acceptPoliciesIfNone(
    LoggedIn toEmit, AppModel app, MemberModel member) async {
  var theAppPolicies = await appPolicyRepository(appId: app.documentID)!
      .valuesListWithDetails();
  if (theAppPolicies.isEmpty) {
    await LoggedIn.acceptMembership(member, app);
    toEmit = toEmit.withSubscriptions(LoggedIn.getSubscriptions(member));
  }
  return toEmit;
}