Merge pull request #5402 from pangeachat/5393-before-voice-message-recording-starts-give-indicator

chore: show loading indicator on recording dialog start up
This commit is contained in:
ggurdin 2026-01-23 12:41:02 -05:00 committed by GitHub
commit 038af42bb3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -35,6 +35,7 @@ class RecordingDialogState extends State<RecordingDialog> {
// #Pangea
// bool error = false;
Object? error;
bool _loading = true;
// Pangea#
final _audioRecorder = AudioRecorder();
@ -87,7 +88,13 @@ class RecordingDialogState extends State<RecordingDialog> {
path: path ?? '',
);
setState(() => _duration = Duration.zero);
// #Pangea
// setState(() => _duration = Duration.zero);
setState(() {
_duration = Duration.zero;
_loading = false;
});
// Pangea#
_recorderSubscription?.cancel();
_recorderSubscription =
Timer.periodic(const Duration(milliseconds: 100), (_) async {
@ -202,7 +209,16 @@ class RecordingDialogState extends State<RecordingDialog> {
const SizedBox(width: 8),
SizedBox(
width: 48,
child: Text(time),
// #Pangea
// child: Text(time),
child: _loading
? const SizedBox(
width: 16,
height: 16,
child: CircularProgressIndicator.adaptive(),
)
: Text(time),
// Pangea#
),
],
);