Fix crash

This commit is contained in:
ivan2282
2025-11-30 19:41:36 +03:00
parent e861b3c8e7
commit e7ff7af96f

View File

@@ -146,21 +146,21 @@ extension ApiServiceAuth on ApiService {
if (currentAccount != null) { if (currentAccount != null) {
authToken = currentAccount.token; authToken = currentAccount.token;
userId = currentAccount.userId; userId = currentAccount.userId;
print( // print(
"Токен загружен из AccountManager: ${authToken!.substring(0, 20)}...", // "Токен загружен из AccountManager: ${authToken!.substring(0, 20)}...",
); // );
} else { } else {
final prefs = await SharedPreferences.getInstance(); final prefs = await SharedPreferences.getInstance();
authToken = prefs.getString('authToken'); authToken = prefs.getString('authToken');
userId = prefs.getString('userId'); userId = prefs.getString('userId');
if (authToken != null) { // if (authToken != null) {
print( // print(
"Токен загружен из SharedPreferences: ${authToken!.substring(0, 20)}...", // "Токен загружен из SharedPreferences: ${authToken!.substring(0, 20)}...",
); // );
if (userId != null) { // if (userId != null) {
print("UserID загружен из SharedPreferences: $userId"); // print("UserID загружен из SharedPreferences: $userId");
} // }
} // }
} }
} }
return authToken != null; return authToken != null;