Updated Settings Page
This commit is contained in:
@@ -228,6 +228,19 @@ class AccountProvider extends ChangeNotifier {
|
||||
}
|
||||
}
|
||||
|
||||
Future<Account> resetUsername(String userName) async {
|
||||
if (account == null) throw ErrorUnauthorized();
|
||||
_setResource(_resource.copyWith(isLoading: true, error: null));
|
||||
try {
|
||||
final updated = await AccountService.resetUsername(account!, userName);
|
||||
_setResource(Resource(data: updated, isLoading: false));
|
||||
return updated;
|
||||
} catch (e) {
|
||||
_setResource(_resource.copyWith(isLoading: false, error: toException(e)));
|
||||
rethrow;
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> forgotPassword(String email) async {
|
||||
_setResource(_resource.copyWith(isLoading: true, error: null));
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user