Improve entries page and latest changes panel, units on events and timeline
All checks were successful
All checks were successful
This commit is contained in:
@@ -128,7 +128,9 @@ extension _NewEntrySubmitLogic on _NewEntryPageState {
|
||||
);
|
||||
_lastSubmittedSnapshot = snapshot;
|
||||
_activeDraftId = null;
|
||||
} catch (e) {
|
||||
} catch (e, st) {
|
||||
debugPrint('Leg submit/update failed: $e');
|
||||
debugPrintStack(stackTrace: st);
|
||||
if (!mounted) return;
|
||||
messenger?.showSnackBar(
|
||||
SnackBar(content: Text('Failed to submit: $e')),
|
||||
|
||||
@@ -73,6 +73,8 @@ extension _NewEntryTractionLogic on _NewEntryPageState {
|
||||
for (var i = 0; i < _tractionItems.length; i++) {
|
||||
final item = _tractionItems[i];
|
||||
if (item.isMarker || item.loco == null) continue;
|
||||
final locoId = item.loco!.id;
|
||||
if (locoId == 0) continue;
|
||||
int allocPos;
|
||||
if (i > markerIndex) {
|
||||
allocPos = -(i - markerIndex);
|
||||
@@ -80,8 +82,7 @@ extension _NewEntryTractionLogic on _NewEntryPageState {
|
||||
allocPos = (markerIndex - 1) - i;
|
||||
}
|
||||
payload.add({
|
||||
"loco_type": item.loco!.type,
|
||||
"loco_number": item.loco!.number,
|
||||
"loco_id": locoId,
|
||||
"alloc_pos": allocPos,
|
||||
"alloc_powering": item.powering ? 1 : 0,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user