It seems to be because of the changes in #3, which make context.notes gets reloaded every time Idling is entered. To be more precise, the state transitions are:
Idling: the "normal" screen
Idling.PasswordDecrypt: the password prompt
DataDecrypting: the decryption
Idling: the "normal" screen
When the state transits from step 3 to step 4, within context, note gets recorded and the relevant element in notes is mutated as well, but the mutation is overrode by entering Idling.
We have two ways to solve this:
On entering Idling, compare each of the fetched records with context.note, then change matched record.
Rearrange the state machine so that entering Idling doesn't reload context.notes.
It seems to be because of the changes in #3, which make
context.notes
gets reloaded every timeIdling
is entered. To be more precise, the state transitions are:Idling
: the "normal" screenIdling.PasswordDecrypt
: the password promptDataDecrypting
: the decryptionIdling
: the "normal" screenWhen the state transits from step 3 to step 4, within
context
,note
gets recorded and the relevant element innotes
is mutated as well, but the mutation is overrode by enteringIdling
.We have two ways to solve this:
Idling
, compare each of the fetched records withcontext.note
, then change matched record.Idling
doesn't reloadcontext.notes
.