updated the sheet
This commit is contained in:
@@ -34,6 +34,7 @@ import 'package:miler/xpress/views/Dashboard/deliveries/deliveries.dart'
|
||||
as deliveries;
|
||||
import 'package:miler/xpress/background/live_tracking_service.dart';
|
||||
import 'package:miler/xpress/data/delivery_api.dart';
|
||||
import 'package:miler/data/heartbeat.dart';
|
||||
|
||||
/// Helper function to launch phone dialer - works in both debug and release builds
|
||||
/// In release builds, canLaunchUrl may fail due to R8/ProGuard, so we always try to launch
|
||||
@@ -320,11 +321,13 @@ class _HomepageState extends State<Homepage>
|
||||
Future<Duration> _getLogInterval() async {
|
||||
try {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
final secs = prefs.getInt('logseconds');
|
||||
final int interval = (secs != null && secs > 0) ? secs : 30;
|
||||
// Already correct — routed through the shared resolver so the 30 lives in
|
||||
// one place. See [kDefaultLogSeconds] for what a zero here used to cost
|
||||
// the rider-log loop, which read the same pref and did not guard it.
|
||||
final int interval = resolveLogSeconds(prefs.getInt('logseconds'));
|
||||
return Duration(seconds: interval);
|
||||
} catch (_) {
|
||||
return const Duration(seconds: 30);
|
||||
return const Duration(seconds: kDefaultLogSeconds);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user