Create a new id for when setting new logs

This commit is contained in:
Roland Geider
2026-05-01 19:03:47 +02:00
parent e56d5a8861
commit df9a69d0ff

View File

@@ -18,6 +18,7 @@
import 'package:clock/clock.dart';
import 'package:logging/logging.dart';
import 'package:powersync/powersync.dart' show uuid;
import 'package:riverpod_annotation/riverpod_annotation.dart';
import 'package:wger/models/workouts/log.dart';
import 'package:wger/models/workouts/repetition_unit.dart';
@@ -36,7 +37,8 @@ class GymLogNotifier extends _$GymLogNotifier {
}
void setLog(Log log) {
final newLog = log.copyWith(id: null, date: clock.now());
// Mint a fresh uuid explicitly
final newLog = log.copyWith(id: uuid.v7(), date: clock.now());
state = newLog;
}