iOS crypto target

This commit is contained in:
Ivan Murashov
2018-03-11 01:40:57 +03:00
parent cae46b60f9
commit c229ea8c9e
41 changed files with 811 additions and 192 deletions

View File

@@ -59,28 +59,25 @@ class RegistrationScreenState extends BaseState<FinishRegistrationScreen> {
// Если токен активирован, то открывается экран со сканером,
// Если нет, то отправляется запрос на проверку статуса токена.
handleTap() async {
handleTap() {
print('tokenActive: $_tokenActive');
if (_tokenActive) {
new Future.delayed(const Duration(milliseconds: 200), () {
Navigator.of(context).pop();
});
Navigator.of(context).pop(true);
} else {
if (await platform.invokeMethod('isOnline')) {
String token = await helper.getToken();
getCheckTokenStatusRequest(token).then((response) {
Map parsedMap = JSON.decode(response.body);
// Обновить экран, заменить сообщение о необходимости активации токена, на сообщние о том, что токен активен.
setState(() {
_tokenActive = parsedMap['active'];
platform.invokeMethod('isOnline').then((isOnline) {
if (isOnline ) {
helper.getToken().then((token) {
getCheckTokenStatusRequest(token).then((response) {
setState(() {
_tokenActive = JSON.decode(response.body)['active'];
});
}).catchError((error) {
print(error.toString());
return false;
});
});
}).catchError((error) {
print(error.toString());
return false;
});
}
}
});
}
}