fix login and add notifications

This commit is contained in:
Phuoc Nguyen
2025-11-26 17:46:09 +07:00
parent 88ac2f2f07
commit dc8e60f589
14 changed files with 517 additions and 33 deletions

View File

@@ -88,10 +88,8 @@ class Auth extends _$Auth {
@override
Future<User?> build() async {
// Simple initialization - just check if user is logged in
// Don't call getSession() here to avoid ref disposal issues
// Do this ONCE on app startup and don't rebuild
try {
final secureStorage = ref.read(secureStorageProvider);
// Check if "Remember Me" was enabled
final rememberMe = await _localDataSource.getRememberMe();
@@ -101,6 +99,7 @@ class Auth extends _$Auth {
}
// Check if we have a stored session
final secureStorage = ref.read(secureStorageProvider);
final sid = await secureStorage.read(key: 'frappe_sid');
final userId = await secureStorage.read(key: 'frappe_user_id');
final fullName = await secureStorage.read(key: 'frappe_full_name');