Skip to content

armgit / ente

Public Imported from GitHub
0

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

chore(photos): remove commented gallery app bar code

Priyanshu Dangare63027bcf34a5
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 175a79a308..506cdea564 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
@@ -1181,135 +1181,6 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
setState(() {});
}
- // 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();
- // } else {
- // await castService.closeActiveCasts();
- // }
-
- // if (!Platform.isAndroid && !kDebugMode) {
- // await _pairWithPin(gw, '');
- // } else {
- // final result = await showDialog<ButtonResult?>(
- // context: context,
- // barrierDismissible: true,
- // useRootNavigator: false,
- // builder: (BuildContext context) {
- // return const CastChooseDialog();
- // },
- // );
- // if (result == null) {
- // return;
- // }
- // // wait to allow the dialog to close
- // await Future.delayed(const Duration(milliseconds: 100));
- // if (result.action == ButtonAction.first) {
- // await showDialog(
- // useRootNavigator: false,
- // context: context,
- // barrierDismissible: true,
- // builder: (BuildContext bContext) {
- // return AutoCastDialog((device) async {
- // await _castPair(bContext, gw, device);
- // Navigator.pop(bContext);
- // });
- // },
- // );
- // }
- // if (result.action == ButtonAction.second) {
- // await _pairWithPin(gw, '');
- // }
- // }
- // }
-
- // Future<void> _pairWithPin(CastGateway gw, String code) async {
- // await showTextInputDialog(
- // context,
- // title: context.l10n.playOnTv,
- // body: AppLocalizations.of(
- // context,
- // ).castInstruction(castUrl: flagService.castUrl),
- // submitButtonLabel: AppLocalizations.of(context).pair,
- // textInputType: TextInputType.streetAddress,
- // hintText: context.l10n.deviceCodeHint,
- // showOnlyLoadingState: true,
- // alwaysShowSuccessState: false,
- // initialValue: code,
- // onSubmit: (String text) async {
- // final bool paired = await _castPair(context, gw, text);
- // if (!paired) {
- // Future.delayed(Duration.zero, () => _pairWithPin(gw, code));
- // }
- // },
- // );
- // }
-
- // String lastCode = '';
- // Future<bool> _castPair(
- // BuildContext bContext,
- // CastGateway gw,
- // String code,
- // ) async {
- // try {
- // if (lastCode == code) {
- // return false;
- // }
- // lastCode = code;
- // _logger.info("Casting album to device with code $code");
- // final String? publicKey = await gw.getPublicKey(code);
- // if (publicKey == null) {
- // showToast(context, AppLocalizations.of(context).deviceNotFound);
-
- // return false;
- // }
- // final String castToken = const Uuid().v4().toString();
- // final castPayload = CollectionsService.instance.getCastData(
- // castToken,
- // widget.collection!,
- // publicKey,
- // );
- // await gw.publishCastPayload(
- // code,
- // castPayload,
- // widget.collection!.id,
- // castToken,
- // );
- // _logger.info("cast album completed");
- // return true;
- // } catch (e, s) {
- // lastCode = '';
- // _logger.severe("Failed to cast album", e, s);
- // if (e is CastIPMismatchException) {
- // await showErrorDialog(
- // context,
- // AppLocalizations.of(context).castIPMismatchTitle,
- // AppLocalizations.of(context).castIPMismatchBody,
- // );
- // } else {
- // await showGenericErrorDialog(context: bContext, error: e);
- // }
- // return false;
- // }
- // }
-
Future<void> _onGalleryGuestViewClick() async {
if (await LocalAuthentication().isDeviceSupported()) {
// Get all files from the collection with proper sort order