Files
buzz/mobile/lib/shared/read_state/read_state_time.dart
feccf4eabc Polish mobile inbox and media flows (#4512)
## Summary

- make mobile unread state visible with bold channel names, an animated
Inbox badge, and swipe-to-toggle Inbox rows
- add directional transitions for top-level mobile navigation
- let mobile send while media uploads, with cancellable progress UI
- normalize iOS and Android video uploads, attach poster frames, and
improve native video playback

## Validation

- `just mobile-check`
- `just mobile-test`
- `cargo test -p buzz-media`
- Pixel smoke test
- iPhone smoke test

Desktop background uploads moved to #4522 so the two platforms can be
reviewed independently.

---------

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Signed-off-by: Tom Brow <tomb@block.xyz>
Co-authored-by: leader <71e9f2c44a6932b6772caaaccda1911d010463c3e2c6c40410b8329956046801@buzz.block.builderlab.xyz>
Co-authored-by: Tom Brow <tomb@block.xyz>
2026-08-04 00:05:13 -07:00

26 lines
614 B
Dart

const _millisecondsPerSecond = 1000;
int? dateTimeToUnixSeconds(DateTime? value) {
if (value == null) return null;
return value.millisecondsSinceEpoch ~/ _millisecondsPerSecond;
}
int currentUnixSeconds() => dateTimeToUnixSeconds(DateTime.now())!;
DateTime unixSecondsToDateTime(int value) {
return DateTime.fromMillisecondsSinceEpoch(
value * _millisecondsPerSecond,
isUtc: true,
);
}
int? isoToUnixSeconds(Object? value) {
if (value is! String || value.isEmpty) {
return null;
}
return dateTimeToUnixSeconds(DateTime.tryParse(value));
}
const readStateMaxClockDriftSeconds = 300;