Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mobile][photos] feature gate the new behaviour of re-casting the same album again

Priyanshu Dangared11fe028a95c
diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_widget.dart b/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_widget.dart
index 54637d6718..24da3d6535 100644
--- a/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_widget.dart
+++ b/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_widget.dart
@@ -1145,6 +1145,25 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
Future<void> _castChoiceDialog() async {
final gw = CastGateway(NetworkClient.instance.enteDio);
+ if (!flagService.enableMultiCast) {
+ if (castService.getActiveSessions().isNotEmpty) {
+ await showChoiceDialog(
+ context,
+ title: AppLocalizations.of(context).stopCastingTitle,
+ firstButtonLabel: AppLocalizations.of(context).yes,
+ secondButtonLabel: AppLocalizations.of(context).no,
+ body: AppLocalizations.of(context).stopCastingBody,
+ firstButtonOnTap: () async {
+ gw.revokeAllTokens().ignore();
+ await castService.closeActiveCasts();
+ },
+ );
+ return;
+ }
+ // stop any existing cast session
+ gw.revokeAllTokens().ignore();
+ }
+
if (!Platform.isAndroid && !kDebugMode) {
await _pairWithPin(gw, '');
} else {