mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-12 14:16:12 +00:00
fix(medications): silence a switched-off module and an ended course
With the Medications module switched off, dose reminders, missed-dose rows and low-stock alerts kept coming, a tap on one landed on "Medications is switched off", and the Telegram buttons still booked intakes. The reminder tick now drops the medications of an owner with the module off, one module read per owner and tick, so neither a reminder nor a missed-dose placeholder is written while it is off. The low-stock pass skips such a user, as the mood reminder does for its module, and the bot offers and books nothing. A medication whose course had ended still counted as live: the low-stock pass kept warning about its stock, and the bot's /add list offered it and booked a dose after the end, taking a unit off the stock. The low-stock pass and every bot path now skip a course that has ended on the person's clock. A course that has not started yet keeps its reorder warning and stays in the bot. A paused medication is already active: false, so the existing filter keeps it out. The bot's six copies of the medication lookup go through one helper.
This commit is contained in:
1 parent
8057bb20bc
commit
71fe874ef2
12 files changed
+451
-75
No files matched your search
@@ -339,8 +339,8 @@
|
||||
"lib/support/report.ts :: collectSupportReportFacts": 332,
|
||||
"lib/targets/build-response.ts :: buildTargetsResponse": 330,
|
||||
"lib/targets/vitals-builder.ts :: buildVitalTargets": 324,
|
||||
"lib/telegram-webhook-handlers.ts :: handleCallback": 599,
|
||||
"lib/telegram-webhook-handlers.ts :: handleTextMessage": 337,
|
||||
"lib/telegram-webhook-handlers.ts :: handleCallback": 582,
|
||||
"lib/telegram-webhook-handlers.ts :: handleTextMessage": 322,
|
||||
"lib/withings/sync-activity.ts :: syncUserActivity": 377,
|
||||
"lib/withings/sync-ecg.ts :: syncUserEcg": 202,
|
||||
"lib/withings/sync-sleep.ts :: syncUserSleep": 414,
|
||||
|
||||
Reference in new issue
Block a user