Erweiterungen
This commit is contained in:
1 parent
ba1f7d5440
commit
bb3dc9e856
28 files changed
+1672
-1291
No files matched your search
@@ -16,6 +16,7 @@ import 'package:stadtbote/model/chat_message.dart';
|
||||
import 'package:stadtbote/model/location_status.dart';
|
||||
import 'package:stadtbote/model/rank.dart';
|
||||
import 'package:stadtbote/model/status.dart';
|
||||
import 'package:stadtbote/model/tour_file.dart';
|
||||
import 'package:stadtbote/objectbox.g.dart';
|
||||
import 'package:stadtbote/network_messages/acknowledge_job.dart';
|
||||
import 'package:stadtbote/network_messages/acknowledge_message.dart';
|
||||
@@ -401,8 +402,16 @@ class MqttCore with ProducerMixin, ConsumerMixin {
|
||||
query.close();
|
||||
|
||||
if (existingJob != null) {
|
||||
// Update existing job
|
||||
// Update existing job - preserve the ID
|
||||
newJob.id = existingJob.id;
|
||||
|
||||
// Ensure files are updated even if the job already exists
|
||||
// This handles migration from old app versions without files support
|
||||
if (payloadData['files'] != null) {
|
||||
newJob.files = (payloadData['files'] as List<dynamic>)
|
||||
.map((e) => TourFile.fromJson(e as Map<String, dynamic>))
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
box.put(newJob);
|
||||
@@ -754,7 +763,7 @@ class MqttCore with ProducerMixin, ConsumerMixin {
|
||||
|
||||
void _commandLogoutReceived(Map<String, dynamic> payload) {
|
||||
try {
|
||||
String timestamp = payload['timestamp'] ?? 'Unknown timestamp';
|
||||
String timestamp = payload['timestamp']?.toString() ?? 'Unknown timestamp';
|
||||
Util.logInfo('Command logout received with timestamp: $timestamp');
|
||||
|
||||
// Disconnect MQTT client gracefully
|
||||
|
||||
Reference in new issue
Block a user