updateUserStatus method

  1. @override
Future<void> updateUserStatus(
  1. UserTextStatus? status
)
override

Updates or resets the MyUser.status field of the authenticated MyUser.

Implementation

@override
Future<void> updateUserStatus(UserTextStatus? status) async {
  Log.debug('updateUserStatus($status)', '$runtimeType');

  await _debounce(
    field: MyUserField.name,
    current: () => myUser.value?.status,
    saved: () async => (await _active)?.value.status,
    value: status,
    mutation: (v, _) => _graphQlProvider.updateUserStatus(v),
    update: (v, _) => myUser.update((u) => u?.status = v),
  );
}