Things I would do differently:
- replace every
any
with a real type - move all interaction with
Storage
out of this page and into a service - declare return types for all functions
- get rid of the
setTimeout
- either lose the
async
ongetSettings
or make it actually return aPromise
that resolves when it’s done (usingPromise.all
, for example) - consider putting all of these things into a single object, so that you are only hitting
Storage
once to fetch/save them all - use reactive forms
Finally, and most germane to your most immediate problem, see this thread. You have two sets of competing/conflicting sources of truth in several places, such as fueltype
and fueltypeVal
. I would lose the ones ending in Val
and the value
attributes that reference them.