Fehlerkorrekturen und Erweiterungen
This commit is contained in:
1 parent
265d75a99b
commit
47b4c85133
14 files changed
+155
-125
No files matched your search
@@ -591,7 +591,7 @@ class MqttCore with ProducerMixin, ConsumerMixin {
|
||||
}
|
||||
|
||||
_sendSyncMessage() async {
|
||||
var currentPosition = MyApp.currentPosition;
|
||||
var currentPosition = await MyApp.getCurrentPosition();
|
||||
|
||||
var jobs = await MyApp.isarInstance.jobs.filter().stateGreaterThan(-1).findAll();
|
||||
|
||||
@@ -617,9 +617,11 @@ class MqttCore with ProducerMixin, ConsumerMixin {
|
||||
}
|
||||
|
||||
void _startTrackTimer() {
|
||||
_trackTimer ??= Timer.periodic(const Duration(seconds: 120), (Timer t) {
|
||||
_cancelTrackTimer();
|
||||
|
||||
_trackTimer ??= Timer.periodic(const Duration(seconds: 120), (Timer t) async {
|
||||
try {
|
||||
var position = MyApp.currentPosition;
|
||||
var position = await MyApp.getCurrentPosition();
|
||||
if (position != null) {
|
||||
var trackMessage = TrackPosition();
|
||||
trackMessage.time = position.timestamp.toIso8601String();
|
||||
@@ -636,8 +638,11 @@ class MqttCore with ProducerMixin, ConsumerMixin {
|
||||
}
|
||||
|
||||
void _cancelTrackTimer() {
|
||||
if (_trackTimer != null && _trackTimer!.isActive) {
|
||||
_trackTimer!.cancel();
|
||||
if (_trackTimer != null) {
|
||||
if (_trackTimer!.isActive) {
|
||||
_trackTimer!.cancel();
|
||||
}
|
||||
|
||||
_trackTimer = null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user