syncOnLaunch method

Future<void> syncOnLaunch()

Syncs preferences with the cloud on app launch.

If local changes were not uploaded (dirty flag set), syncs up first to avoid overwriting them. Then syncs down to pull any cloud changes.

Implementation

Future<void> syncOnLaunch() async {
  if (!_isLoggedIn()) return;
  if (await _isDirty()) await syncUp();
  await syncDown();
}