From 5fc5c7de2b0bfd2e0054250a4ad983b0caba2f87 Mon Sep 17 00:00:00 2001 From: Misaka Date: Thu, 21 May 2026 21:02:22 +0800 Subject: [PATCH] fix: skip shelf-switch warning when no previous shelf scanned in multi-code mode In multi-code shelving mode, if the user has scanned zongpai numbers but hasn't scanned any shelf yet, scanning the first shelf should not trigger the "switch shelf" warning dialog since there is no existing shelf to switch from. Co-Authored-By: Claude Opus 4.6 --- lib/pages/registration/parts/registration_scan_part.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/pages/registration/parts/registration_scan_part.dart b/lib/pages/registration/parts/registration_scan_part.dart index 7b0293c..dd057e9 100644 --- a/lib/pages/registration/parts/registration_scan_part.dart +++ b/lib/pages/registration/parts/registration_scan_part.dart @@ -60,8 +60,10 @@ extension _RegistrationScanPart on _RegistrationPageState { } void _handleLocationScan(String locationCode, CodeType locationType) { - // In singleCode mode or no existing data, switch directly - if (_mode == RegistrationMode.singleCode || _zongpaiNos.isEmpty) { + // In singleCode mode or no existing data or no previous shelf, switch directly + if (_mode == RegistrationMode.singleCode || + _zongpaiNos.isEmpty || + _locationCode == null) { _feedbackService.trigger(FeedbackEvent.scanValid); setState(() { _locationCode = locationCode;