offline options globally toggleable

This commit is contained in:
stopflock
2026-07-25 20:40:15 -05:00
parent 6f017fd6c1
commit dfcc64e96e
24 changed files with 489 additions and 92 deletions
+18
View File
@@ -158,6 +158,8 @@ class AppState extends ChangeNotifier {
FollowMeMode get followMeMode => _settingsState.followMeMode;
bool get keepScreenAwake => _settingsState.keepScreenAwake;
bool get hideZoomControls => _settingsState.hideZoomControls;
bool get offlineFeaturesEnabled => _settingsState.offlineFeaturesEnabled;
bool get proximityAlertsEnabled => _settingsState.proximityAlertsEnabled;
@@ -691,6 +693,22 @@ class AppState extends ChangeNotifier {
await _settingsState.setHideZoomControls(enabled);
}
/// Set the master "offline features enabled" toggle. When disabling,
/// also forces offlineMode off (if it was on) and cancels any active
/// area downloads, so we never end up "in offline mode" with the
/// feature disabled. Does NOT delete existing offline area data — that
/// is a separate, explicit user choice handled by the UI.
Future<void> setOfflineFeaturesEnabled(bool enabled) async {
await _settingsState.setOfflineFeaturesEnabled(enabled);
if (!enabled) {
if (offlineMode) {
await setOfflineMode(false);
}
await OfflineAreaService().cancelActiveDownloads();
}
}
Future<void> setPauseQueueProcessing(bool enabled) async {
await _settingsState.setPauseQueueProcessing(enabled);