Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][photos] Fix: Cast not working on android (Pair with PIN option)

ashilkn8965f1cd09f9
diff --git a/mobile/lib/ui/cast/choose.dart b/mobile/lib/ui/cast/choose.dart
index bd4c9876de..e0997f4403 100644
--- a/mobile/lib/ui/cast/choose.dart
+++ b/mobile/lib/ui/cast/choose.dart
@@ -44,9 +44,6 @@ class _CastChooseDialogState extends State<CastChooseDialog> {
buttonAction: ButtonAction.first,
shouldSurfaceExecutionStates: false,
isInAlert: true,
- onTap: () async {
- Navigator.of(context).pop(ButtonAction.first);
- },
),
const SizedBox(height: 36),
Text(
@@ -61,9 +58,7 @@ class _CastChooseDialogState extends State<CastChooseDialog> {
icon: Icons.tv_outlined,
buttonSize: ButtonSize.large,
isInAlert: true,
- onTap: () async {
- Navigator.of(context).pop(ButtonAction.second);
- },
+
shouldStickToDarkTheme: true,
buttonAction: ButtonAction.second,
shouldSurfaceExecutionStates: false,
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 5672fcc5c1..d85ec9a870 100644
--- a/mobile/lib/ui/viewer/gallery/gallery_app_bar_widget.dart
+++ b/mobile/lib/ui/viewer/gallery/gallery_app_bar_widget.dart
@@ -17,6 +17,7 @@ import "package:photos/gateways/cast_gw.dart";
import "package:photos/generated/l10n.dart";
import "package:photos/l10n/l10n.dart";
import 'package:photos/models/backup_status.dart';
+import "package:photos/models/button_result.dart";
import 'package:photos/models/collection/collection.dart';
import 'package:photos/models/device_collection.dart';
import 'package:photos/models/gallery_type.dart';
@@ -861,7 +862,7 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
if (!Platform.isAndroid && !kDebugMode) {
await _pairWithPin(gw, '');
} else {
- final result = await showDialog<ButtonAction?>(
+ final result = await showDialog<ButtonResult?>(
context: context,
barrierDismissible: true,
useRootNavigator: false,
@@ -872,9 +873,8 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
if (result == null) {
return;
}
- // wait to allow the dialog to close
await Future.delayed(const Duration(milliseconds: 100));
- if (result == ButtonAction.first) {
+ if (result.action == ButtonAction.first) {
await showDialog(
useRootNavigator: false,
context: context,
@@ -889,7 +889,7 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
},
);
}
- if (result == ButtonAction.second) {
+ if (result.action == ButtonAction.second) {
await _pairWithPin(gw, '');
}
}