Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob][cast] Fix cast progress state

Neeraj Guptad779fc05bdd1
diff --git a/mobile/lib/ui/cast/auto.dart b/mobile/lib/ui/cast/auto.dart
index 7b310855e3..34c97b34de 100644
--- a/mobile/lib/ui/cast/auto.dart
+++ b/mobile/lib/ui/cast/auto.dart
@@ -79,12 +79,6 @@ class _AutoCastDialogState extends State<AutoCastDialog> {
});
try {
await _connectToYourApp(context, device);
- if (mounted) {
- setState(() {
- _isDeviceTapInProgress.remove(device);
- });
- Navigator.of(context).pop();
- }
} catch (e) {
if (mounted) {
setState(() {
@@ -128,6 +122,11 @@ class _AutoCastDialogState extends State<AutoCastDialog> {
final code = message[CastMessageType.pairCode]!['code'];
widget.onConnect(code);
}
+ if (mounted) {
+ setState(() {
+ _isDeviceTapInProgress.remove(castDevice);
+ });
+ }
},
);
}
diff --git a/mobile/lib/ui/viewer/gallery/gallery_app_bar_widget.dart b/mobile/lib/ui/viewer/gallery/gallery_app_bar_widget.dart
index 3ca2f6c2a4..4e5c2d96e2 100644
--- a/mobile/lib/ui/viewer/gallery/gallery_app_bar_widget.dart
+++ b/mobile/lib/ui/viewer/gallery/gallery_app_bar_widget.dart
@@ -758,6 +758,7 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
return AutoCastDialog(
(device) async {
await _castPair(bContext, gw, device);
+ Navigator.pop(bContext);
},
);
},