Skip to content

Commit

Permalink
By default enable syncing even on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
inetic committed Sep 27, 2022
1 parent 592c612 commit 7a401ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions lib/app/cubits/power_control.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ class PowerControl extends WatchSelf<PowerControl> {
bool? _isNetworkEnabled;
String? _networkDisabledReason;
ConnectivityResult? _lastConnectionType;
bool _syncOnMobile = false;
static final bool _syncOnMobileDefault = true;
bool _syncOnMobile = _syncOnMobileDefault;

PowerControl(this._repos, this._settings) {
// TODO: Should we unsusbscribe somewhere?
_connectivity.onConnectivityChanged.listen(_updateConnectionStatus);
}

Future<void> init() async {
_syncOnMobile = _settings.getEnableSyncOnMobile();
_syncOnMobile = _settings.getEnableSyncOnMobile(_syncOnMobileDefault);
final current = await _connectivity.checkConnectivity();
_updateConnectionStatus(current);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/app/utils/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ class Settings {
await _prefs.setBool(_syncOnMobileKey, enable);
}

bool getEnableSyncOnMobile() {
return _prefs.getBool(_syncOnMobileKey) ?? false;
bool getEnableSyncOnMobile(bool default_) {
return _prefs.getBool(_syncOnMobileKey) ?? default_;
}

Future<void> setHighestSeenProtocolNumber(int number) async {
Expand Down

0 comments on commit 7a401ae

Please sign in to comment.