Fixed attendance

This commit is contained in:
2026-06-05 10:34:26 +08:00
parent 5d818e0d4f
commit 5e20d14f23
2 changed files with 70 additions and 1 deletions
@@ -1593,7 +1593,15 @@ class _CheckInTabState extends ConsumerState<_CheckInTab> {
}
} catch (e) {
if (mounted) {
showErrorSnackBar(context, 'Overtime check-in failed: $e');
final msg = e.toString();
final friendly = msg.contains('Outside geofence')
? 'You are outside the geofence area.'
: msg.contains('Not authenticated')
? 'Session expired. Please log in again.'
: msg.contains('no candidate')
? 'Overtime check-in is temporarily unavailable. Please try again.'
: 'Overtime check-in failed. Please try again.';
showErrorSnackBar(context, friendly);
}
} finally {
if (mounted) setState(() => _loading = false);