File tree Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -9,9 +9,12 @@ class LoginController {
9
9
static final _logger = LoggerService .getLogger ('LoginController' );
10
10
static final AuthAPIHandler _authAPIHandler = AuthAPIHandler ();
11
11
12
+ static bool validatedToken = false ;
13
+
12
14
static Future <void > init () async {
13
15
await XAuthTokenCacheHandler .init ();
14
16
await UserCacheHandler .init ();
17
+ await validateToken ();
15
18
}
16
19
17
20
static Future <Map <String , dynamic >?> login (
@@ -80,10 +83,12 @@ class LoginController {
80
83
}
81
84
}
82
85
83
- static bool validatedToken = false ;
84
-
85
86
static Future <bool > get isLoggedIn async {
86
87
if (! (await XAuthTokenCacheHandler .hasToken)) return false ;
88
+ return await validateToken ();
89
+ }
90
+
91
+ static Future <bool > validateToken () async {
87
92
if (validatedToken) return true ;
88
93
89
94
try {
Original file line number Diff line number Diff line change @@ -9,10 +9,10 @@ import '../../controllers/auth/login.dart';
9
9
import '../../controllers/toast/toast.dart' ;
10
10
import '../localization/settings.dart' ;
11
11
12
- const String appVersion = 'v1.1.5 ' ;
12
+ const String appVersion = 'v1.1.6 ' ;
13
13
final Uri devUri = Uri .parse ('https://github.com/SmartShed' );
14
- final Uri latestAppUri =
15
- Uri . parse ( 'https://github.com/SmartShed/App/releases/latest' );
14
+ final Uri latestAppDownload = Uri . parse (
15
+ 'https://github.com/SmartShed/App/releases/latest/download/SmartShed.apk ' );
16
16
17
17
final Uri contactUsEmailUri = Uri (
18
18
scheme: 'mailto' ,
@@ -340,13 +340,13 @@ class _AppInfoState extends State<AppInfo> {
340
340
),
341
341
onPressed: () async {
342
342
try {
343
- await launchUrl (latestAppUri );
343
+ await launchUrl (latestAppDownload );
344
344
} catch (e) {
345
345
if (! context.mounted) return ;
346
346
ToastController .error (context.formatString (
347
347
Settings_LocaleData .could_not_launch_url
348
348
.getString (context),
349
- [latestAppUri .toString ()]));
349
+ [latestAppDownload .toString ()]));
350
350
}
351
351
},
352
352
child: Row (
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: smartshed
2
2
description : SmartShed Application for Diesel Loco Shed, Pune
3
3
publish_to : ' none'
4
4
5
- version : 1.1.5
5
+ version : 1.1.6
6
6
7
7
environment :
8
8
sdk : ' >=3.1.2 <4.0.0'
You can’t perform that action at this time.
0 commit comments