Kotlin Preference DataStore value gets subtracted whenever I switch to another application or at random moments (2nd version)
In my quiz app, there are in-game currencies: diamonds, coins and lives. By default, the number of lives should be five (when the user first installs the app, with the number of lives going no more than five, but no less than zero).