Skip to content

Commit

Permalink
fix: app_user_database
Browse files Browse the repository at this point in the history
  • Loading branch information
vitormpp committed Jun 5, 2024
1 parent 67929ce commit be9d919
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions uni/lib/controller/local_storage/database/app_user_database.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,22 +74,26 @@ class AppUserDataDatabase extends AppDatabase<Profile> {

/// Saves the user's print balance to the database.
Future<void> saveUserPrintBalance(String userBalance) async {
await insertInDatabase(
'userdata',
{'key': 'printBalance', 'value': userBalance},
);
if (persistentSession) {
await insertInDatabase(
'userdata',
{'key': 'printBalance', 'value': userBalance},
);
}
}

/// Saves the user's balance and payment due date to the database.
///
Future<void> saveUserFees(String feesBalance, DateTime? feesLimit) async {
await insertInDatabase(
'userdata',
{'key': 'feesBalance', 'value': feesBalance},
);
await insertInDatabase('userdata', {
'key': 'feesLimit',
'value': feesLimit != null ? feesLimit.toIso8601String() : '',
});
if (persistentSession) {
await insertInDatabase(
'userdata',
{'key': 'feesBalance', 'value': feesBalance},
);
await insertInDatabase('userdata', {
'key': 'feesLimit',
'value': feesLimit != null ? feesLimit.toIso8601String() : '',
});
}
}
}

0 comments on commit be9d919

Please sign in to comment.