Updated Settings Page

This commit is contained in:
Arseni
2025-12-18 15:15:33 +03:00
parent d649748f6f
commit 0ecd17d2dc
15 changed files with 679 additions and 110 deletions

View File

@@ -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 {