Closed EvanHahn closed 1 month ago
Simplified this a bunch (I think).
When the app is in the background and sync is complete, cores will be un-replicated. There is no longer an auto-stop timeout, but it should be easy to add in the future.
There are now two booleans: wantsToSyncData
and isBackgrounded
.
start()
enables wantsToSyncData
.stop()
disables wantsToSyncData
.background()
enables isBackgrounded
.foreground()
disables isBackgrounded
.After these operations and when the state is updated, #updateState()
is called. This figures out the desired SyncEnabledState
and applies it.
Thanks for all the review here. Hopefully this is the last round!
MapeoManager#onBackgrounded()
should be called when the app goes into the background. It will do its best to gracefully shut down sync.Closes #576.