refactor: migrate JWT storage to secure storage, update assets, and enhance login verification logic.
This commit is contained in:
@@ -939,13 +939,18 @@ class HomeCaptainController extends GetxController {
|
||||
bool isZeroCommissionActive = false;
|
||||
|
||||
getCountRideToday() async {
|
||||
var res = await CRUD().get(
|
||||
var res = await CRUD().getWallet(
|
||||
link: AppLink.getCountRide,
|
||||
payload: {'driver_id': box.read(BoxName.driverID).toString()});
|
||||
data = jsonDecode(res);
|
||||
|
||||
countRideToday = data['message'][0]['count'].toString();
|
||||
update();
|
||||
if (res != 'failure' && res != 'token_expired' && res != 'rate_limited') {
|
||||
try {
|
||||
var dataDecoded = res is String ? jsonDecode(res) : res;
|
||||
if (dataDecoded is Map && dataDecoded['status'] == 'success' && dataDecoded['message'] != null) {
|
||||
countRideToday = dataDecoded['message'][0]['count'].toString();
|
||||
update();
|
||||
}
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
// Fetch Gamification Streak as well
|
||||
getDriverStreak();
|
||||
|
||||
Reference in New Issue
Block a user