mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-16 15:23:29 +00:00
fix(backup): restart the auto-take floor at the restore
A portable file carries no removed doses, so a restored medication with automatic recording on had the pass fill a dose the person deleted in the days before the export. The restored floor is now the later of the file's value and the restore.
This commit is contained in:
1 parent
38900656a3
commit
1ba422b87c
2 files changed
+135
-7
No files matched your search
@@ -1232,14 +1232,21 @@ export async function restoreBackup(
|
||||
oneShot: m.oneShot ?? false,
|
||||
asNeeded: m.asNeeded ?? false,
|
||||
trackIntake: m.trackIntake ?? true,
|
||||
// v1.42.2 — an option that is on always carries its floor; a
|
||||
// file that has the flag without one starts it at the restore,
|
||||
// so the auto-take pass never fills history it did not own.
|
||||
// v1.42.2 — an option that is on always carries its floor, and
|
||||
// a restored floor is never before the restore: a portable file
|
||||
// carries no removed doses, so a dose the person deleted in the
|
||||
// days before the export would otherwise be filled again as
|
||||
// taken by the next auto-take pass.
|
||||
autoMarkTaken: m.autoMarkTaken ?? false,
|
||||
autoMarkTakenSince: m.autoMarkTaken
|
||||
? m.autoMarkTakenSince
|
||||
? new Date(m.autoMarkTakenSince)
|
||||
: new Date()
|
||||
? new Date(
|
||||
Math.max(
|
||||
m.autoMarkTakenSince
|
||||
? Date.parse(m.autoMarkTakenSince)
|
||||
: 0,
|
||||
restoreStartedAt.getTime(),
|
||||
),
|
||||
)
|
||||
: null,
|
||||
deliveryForm: m.deliveryForm ?? "ORAL",
|
||||
trackInjectionSites: m.trackInjectionSites ?? false,
|
||||
|
||||
Reference in new issue
Block a user