mirror of
https://github.com/kuhyx/wake-alarm.git
synced 2026-11-19 00:14:25 +01:00
Say Armed for HH:MM only after a real arm
Some checks are pending
dependency freshness / dependencies on newest stable (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (mypy, mypy, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (pylint, pylint, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (rest, , mypy,pylint,free-days-interop) (push) Waiting to run
Tests / test (push) Waiting to run
Tests / free-days-interop (push) Waiting to run
release-apk / release (APK) (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
Some checks are pending
dependency freshness / dependencies on newest stable (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (mypy, mypy, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (pylint, pylint, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (rest, , mypy,pylint,free-days-interop) (push) Waiting to run
Tests / test (push) Waiting to run
Tests / free-days-interop (push) Waiting to run
release-apk / release (APK) (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
The home screen prefixed it to every publish() result, including the full-screen-intent refusal and sync errors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
7aae649d44
commit
f0de01f9aa
@ -139,9 +139,6 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
// publish attempt was the one at startup, so an alarm moved earlier here
|
||||
// never reached the PC at all.
|
||||
await _syncToPc();
|
||||
if (!mounted) return;
|
||||
// Keep the armed time in the confirmation; the sync result follows it.
|
||||
setState(() => _status = 'Armed for ${_fmt(_hour, _minute)}. $_status');
|
||||
}
|
||||
|
||||
/// Re-reads the policy and arms the alarm to match it.
|
||||
|
||||
@ -61,11 +61,13 @@ class AlarmPublisher {
|
||||
}
|
||||
}
|
||||
|
||||
/// The success line; names the Clock app only when the handoff to it
|
||||
/// completed before its timeout, so a silent timeout never claims it.
|
||||
/// The success line, naming the armed time; names the Clock app only when
|
||||
/// the handoff to it completed before its timeout, so a silent timeout
|
||||
/// never claims it. Only reached after `arm()` succeeded.
|
||||
String syncedStatus(int hour, int minute, {required bool inClock}) {
|
||||
final time =
|
||||
'${hour.toString().padLeft(2, '0')}:'
|
||||
'${minute.toString().padLeft(2, '0')}';
|
||||
return inClock ? 'Synced to PC ✓ Clock app set $time ✓' : 'Synced to PC ✓';
|
||||
final synced = 'Armed for $time. Synced to PC ✓';
|
||||
return inClock ? '$synced Clock app set ✓' : synced;
|
||||
}
|
||||
|
||||
@ -42,8 +42,11 @@ void main() {
|
||||
test('the Clock line names the time only when the handoff completed', () {
|
||||
expect(
|
||||
syncedStatus(6, 5, inClock: true),
|
||||
'Synced to PC ✓ Clock app set 06:05 ✓',
|
||||
'Armed for 06:05. Synced to PC ✓ Clock app set ✓',
|
||||
);
|
||||
expect(
|
||||
syncedStatus(6, 5, inClock: false),
|
||||
'Armed for 06:05. Synced to PC ✓',
|
||||
);
|
||||
expect(syncedStatus(6, 5, inClock: false), 'Synced to PC ✓');
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user