new icons, remove upload dests

This commit is contained in:
stopflock
2025-09-26 14:31:50 -05:00
parent 99ce659064
commit 175bc8831a
47 changed files with 95 additions and 35 deletions
+30
View File
@@ -106,6 +106,36 @@ class AuthService {
}
}
// Restore login state from stored token (for app startup)
Future<String?> restoreLogin() async {
if (_mode == UploadMode.simulate) {
final prefs = await SharedPreferences.getInstance();
final isLoggedIn = prefs.getBool('sim_user_logged_in') ?? false;
if (isLoggedIn) {
_displayName = 'Demo User';
return _displayName;
}
return null;
}
// Get stored token directly from SharedPreferences
final accessToken = await getAccessToken();
if (accessToken == null) {
return null;
}
try {
_displayName = await _fetchUsername(accessToken);
return _displayName;
} catch (e) {
print('AuthService: Error restoring login with stored token: $e');
log('Error restoring login with stored token: $e');
// Token might be expired or invalid, clear it
await logout();
return null;
}
}
Future<void> logout() async {
if (_mode == UploadMode.simulate) {
final prefs = await SharedPreferences.getInstance();