Opravit zobrazení objednání
This commit is contained in:
parent
82f2197a28
commit
973d4b43a5
3 changed files with 7 additions and 4 deletions
|
@ -1,4 +1,6 @@
|
||||||
## 0.1.0-alpha.15
|
## 0.1.0-alpha.15
|
||||||
|
- Opravit zobrazení zda-li jde jídlo objednat, když není objednané žádné jídlo
|
||||||
|
## 0.1.0-alpha.15
|
||||||
- Úprava nakládání s chybami v `_getRequest`
|
- Úprava nakládání s chybami v `_getRequest`
|
||||||
- `fail` je chyba
|
- `fail` je chyba
|
||||||
## 0.1.0-alpha.14
|
## 0.1.0-alpha.14
|
||||||
|
|
|
@ -278,8 +278,9 @@ class Canteen {
|
||||||
.toString()
|
.toString()
|
||||||
.replaceAll(RegExp(r'( )+|([^>a-z]\n)'), '');
|
.replaceAll(RegExp(r'( )+|([^>a-z]\n)'), '');
|
||||||
var objednano = o.contains("Máte objednáno");
|
var objednano = o.contains("Máte objednáno");
|
||||||
var lzeObjednat =
|
var lzeObjednat = !(o.contains("nelze zrušit") ||
|
||||||
!(o.contains("nelze zrušit") || o.contains("nelze objednat"));
|
o.contains("nelze objednat") ||
|
||||||
|
o.contains("nelze změnit"));
|
||||||
var cenaMatch =
|
var cenaMatch =
|
||||||
RegExp(r'(?<=Cena objednaného jídla">).+?(?=&)').firstMatch(o);
|
RegExp(r'(?<=Cena objednaného jídla">).+?(?=&)').firstMatch(o);
|
||||||
cenaMatch ??=
|
cenaMatch ??=
|
||||||
|
@ -463,7 +464,7 @@ class Canteen {
|
||||||
Future<bool> objednatZBurzy(Burza b) async {
|
Future<bool> objednatZBurzy(Burza b) async {
|
||||||
if (!prihlasen) return Future.error("Uživatel není přihlášen");
|
if (!prihlasen) return Future.error("Uživatel není přihlášen");
|
||||||
try {
|
try {
|
||||||
await _getRequest("/faces/secured/" + b.url!); // TODO: SPRAVIT
|
await _getRequest("/faces/secured/" + b.url!);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
name: canteenlib
|
name: canteenlib
|
||||||
description: Library for communication with the czech canteen food ordering system iCanteen
|
description: Library for communication with the czech canteen food ordering system iCanteen
|
||||||
version: 0.1.0-alpha.15
|
version: 0.1.0-alpha.16
|
||||||
repository: 'https://github.com/hernikplays/canteenlib'
|
repository: 'https://github.com/hernikplays/canteenlib'
|
||||||
issue_tracker: 'https://github.com/hernikplays/canteenlib/issues'
|
issue_tracker: 'https://github.com/hernikplays/canteenlib/issues'
|
||||||
documentation: 'https://docs.hernikplays.cz'
|
documentation: 'https://docs.hernikplays.cz'
|
||||||
|
|
Reference in a new issue