25-3/11/1
This commit is contained in:
@@ -36,16 +36,13 @@ class AppInitializer {
|
||||
List<Map<String, dynamic>> links = [];
|
||||
|
||||
Future<void> initializeApp() async {
|
||||
// Log.print('box.read("jwt"): ${box.read(BoxName.jwt)}');
|
||||
if (box.read(BoxName.jwt) == null) {
|
||||
await LoginController().getJWT();
|
||||
} else {
|
||||
// print('firstTimeLoadKey ${box.read(BoxName.firstTimeLoadKey)}');
|
||||
bool isTokenExpired = JwtDecoder.isExpired(X
|
||||
.r(X.r(X.r(box.read(BoxName.jwt), cn), cC), cs)
|
||||
.toString()
|
||||
.split(AppInformation.addd)[0]);
|
||||
// Log.print('isTokenExpired: $isTokenExpired');
|
||||
if (isTokenExpired) {
|
||||
await LoginController().getJWT();
|
||||
}
|
||||
@@ -69,7 +66,6 @@ class AppInitializer {
|
||||
try {
|
||||
var res =
|
||||
await CRUD().get(link: AppLink.getLocationAreaLinks, payload: {});
|
||||
// Log.print('res: ${res}');
|
||||
if (res != 'failure') {
|
||||
links = List<Map<String, dynamic>>.from(jsonDecode(res)['message']);
|
||||
await box.remove(BoxName.locationName);
|
||||
@@ -89,8 +85,6 @@ class AppInitializer {
|
||||
await box.write(BoxName.paymentLink,
|
||||
EncryptionHelper.instance.decryptData(links[4]['server_link']));
|
||||
}
|
||||
} catch (e) {
|
||||
print('Error fetching or decoding location data: $e');
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user