mirror of
https://github.com/wger-project/flutter.git
synced 2026-11-29 09:20:56 +01:00
Create a new id for when setting new logs
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user