new icons, remove upload dests

This commit is contained in:
stopflock
2025-09-26 14:31:50 -05:00
parent 99ce659064
commit 175bc8831a
47 changed files with 95 additions and 35 deletions
+3 -3
View File
@@ -18,7 +18,7 @@ class AuthState extends ChangeNotifier {
try {
if (await _auth.isLoggedIn()) {
_username = await _auth.login();
_username = await _auth.restoreLogin();
}
} catch (e) {
print("AuthState: Error during auth initialization: $e");
@@ -44,7 +44,7 @@ class AuthState extends ChangeNotifier {
Future<void> refreshAuthState() async {
try {
if (await _auth.isLoggedIn()) {
_username = await _auth.login();
_username = await _auth.restoreLogin();
} else {
_username = null;
}
@@ -83,7 +83,7 @@ class AuthState extends ChangeNotifier {
if (await _auth.isLoggedIn()) {
final isValid = await validateToken();
if (isValid) {
_username = await _auth.login();
_username = await _auth.restoreLogin();
} else {
await logout(); // This clears _username also.
}
+15 -1
View File
@@ -4,6 +4,7 @@ import 'package:shared_preferences/shared_preferences.dart';
import 'package:collection/collection.dart';
import '../models/tile_provider.dart';
import '../dev_config.dart';
// Enum for upload mode (Production, OSM Sandbox, Simulate)
enum UploadMode { production, sandbox, simulate }
@@ -26,7 +27,7 @@ class SettingsState extends ChangeNotifier {
bool _offlineMode = false;
int _maxCameras = 250;
UploadMode _uploadMode = UploadMode.simulate;
UploadMode _uploadMode = kEnableDevelopmentModes ? UploadMode.simulate : UploadMode.production;
FollowMeMode _followMeMode = FollowMeMode.northUp;
List<TileProvider> _tileProviders = [];
String _selectedTileTypeId = '';
@@ -98,6 +99,13 @@ class SettingsState extends ChangeNotifier {
await prefs.setInt(_uploadModePrefsKey, _uploadMode.index);
}
// In production builds, force production mode if development modes are disabled
if (!kEnableDevelopmentModes && _uploadMode != UploadMode.production) {
debugPrint('SettingsState: Development modes disabled, forcing production mode');
_uploadMode = UploadMode.production;
await prefs.setInt(_uploadModePrefsKey, _uploadMode.index);
}
// Load tile providers (default to built-in providers if none saved)
await _loadTileProviders(prefs);
@@ -170,6 +178,12 @@ class SettingsState extends ChangeNotifier {
}
Future<void> setUploadMode(UploadMode mode) async {
// In production builds, only allow production mode
if (!kEnableDevelopmentModes && mode != UploadMode.production) {
debugPrint('SettingsState: Development modes disabled, forcing production mode');
mode = UploadMode.production;
}
_uploadMode = mode;
final prefs = await SharedPreferences.getInstance();
await prefs.setInt(_uploadModePrefsKey, mode.index);