From bd18dc7a62f7c8361cf1ff2abd3323cdfe02fac5 Mon Sep 17 00:00:00 2001 From: Neeraj Gupta <254676+ua741@users.noreply.github.com> Date: Thu, 12 Sep 2024 15:40:30 +0530 Subject: [PATCH] [auth] Disable sharing for HOTP codes --- auth/lib/ui/code_widget.dart | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/auth/lib/ui/code_widget.dart b/auth/lib/ui/code_widget.dart index 7ab831c0c4..bb5b3dc221 100644 --- a/auth/lib/ui/code_widget.dart +++ b/auth/lib/ui/code_widget.dart @@ -235,6 +235,13 @@ class _CodeWidgetState extends State { return ContextMenuRegion( contextMenu: ContextMenu( entries: [ + if (!widget.code.isTrashed && + widget.code.type.isTOTPCompatible) + MenuItem( + label: context.l10n.share, + icon: Icons.adaptive.share_outlined, + onSelected: () => _onSharePressed(null), + ), if (!widget.code.isTrashed) MenuItem( label: 'QR', @@ -291,8 +298,9 @@ class _CodeWidgetState extends State { extentRatio: extendRatio, motion: const ScrollMotion(), children: [ - if (!widget.code.isTrashed) SizedBox(width: slideSpace), - if (!widget.code.isTrashed) + if (!widget.code.isTrashed && widget.code.type.isTOTPCompatible) + SizedBox(width: slideSpace), + if (!widget.code.isTrashed && widget.code.type.isTOTPCompatible) SlidableAction( onPressed: _onSharePressed, backgroundColor: Colors.grey.withOpacity(0.1),