Fix: Don't recommend quitting to former smokers

Former smokers have already quit - they can't take further action
on smoking. Treat them as optimal for the smoking behavior.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
John Mizerek 2026-02-21 16:57:08 -08:00
parent 247388c61a
commit fb494a349c

View file

@ -104,7 +104,9 @@ BehavioralInputs _setToOptimal(BehavioralInputs inputs, String behaviorKey) {
bool _isOptimal(BehavioralInputs inputs, String behaviorKey) { bool _isOptimal(BehavioralInputs inputs, String behaviorKey) {
switch (behaviorKey) { switch (behaviorKey) {
case 'smoking': case 'smoking':
return inputs.smoking == SmokingStatus.never; // Former smokers have already quit - no further action possible
return inputs.smoking == SmokingStatus.never ||
inputs.smoking == SmokingStatus.former;
case 'alcohol': case 'alcohol':
return inputs.alcohol == AlcoholLevel.none || return inputs.alcohol == AlcoholLevel.none ||
inputs.alcohol == AlcoholLevel.light; inputs.alcohol == AlcoholLevel.light;