I have done some reading and investigation on this error, but not sure what the correct answer is for my situation. I understand that in dev mode, change detection runs twic
Simply use
setTimeout(() => { //Your expression to change if state });