Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mobile][photos] do not fetch active sessions for the first-time if multi cast feature flag is disabled

Priyanshu Dangare552aaf9e7e8f
diff --git a/mobile/apps/photos/lib/ui/cast/cast.dart b/mobile/apps/photos/lib/ui/cast/cast.dart
index 7bfb6ef790..87dbcfc863 100644
--- a/mobile/apps/photos/lib/ui/cast/cast.dart
+++ b/mobile/apps/photos/lib/ui/cast/cast.dart
@@ -19,13 +19,15 @@ Future<void> showCastSheet(BuildContext context, Collection collection) async {
await castService.closeActiveCasts();
final gw = CastGateway(NetworkClient.instance.enteDio);
final logger = Logger("showCastSheet");
- late final List<CastInfo> sessions;
- try {
- sessions = await gw.getAllCastSessions();
- } catch (e, s) {
- logger.severe('Failed to fetch active sessions in cast sheet: ', e, s);
- await showGenericErrorDialog(context: context, error: e);
- return;
+ List<CastInfo> sessions = [];
+ if (flagService.enableMultiCast) {
+ try {
+ sessions = await gw.getAllCastSessions();
+ } catch (e, s) {
+ logger.severe('Failed to fetch active sessions in cast sheet: ', e, s);
+ await showGenericErrorDialog(context: context, error: e);
+ return;
+ }
}
return showBottomSheetComponent(
context: context,