Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mobile][photos] handle case of multi cast not enabled in server

Priyanshu Dangare76f1168dc504
diff --git a/mobile/apps/photos/lib/ui/cast/pair_with_auto.dart b/mobile/apps/photos/lib/ui/cast/pair_with_auto.dart
index 2b80956bfd..12447fabab 100644
--- a/mobile/apps/photos/lib/ui/cast/pair_with_auto.dart
+++ b/mobile/apps/photos/lib/ui/cast/pair_with_auto.dart
@@ -27,6 +27,9 @@ Future<void> _pairWithAuto(
String code,
) async {
final gw = CastGateway(NetworkClient.instance.enteDio);
+ if (!flagService.enableMultiCast) {
+ await gw.revokeAllTokens();
+ }
final publicKey = await gw.getPublicKey(code);
if (publicKey == null) {
throw const _DeviceNotFoundException();
diff --git a/mobile/apps/photos/lib/ui/cast/pair_with_code.dart b/mobile/apps/photos/lib/ui/cast/pair_with_code.dart
index 74060cdb81..eef2be1ddd 100644
--- a/mobile/apps/photos/lib/ui/cast/pair_with_code.dart
+++ b/mobile/apps/photos/lib/ui/cast/pair_with_code.dart
@@ -21,6 +21,9 @@ Future<void> _pairWithCode(
String code,
) async {
final gw = CastGateway(NetworkClient.instance.enteDio);
+ if (!flagService.enableMultiCast) {
+ await gw.revokeAllTokens();
+ }
final publicKey = await gw.getPublicKey(code);
if (publicKey == null) {
throw const _DeviceNotFoundException();