diff --git a/lib/blocs/file_share/file_share_cubit.dart b/lib/blocs/file_share/file_share_cubit.dart index 93fcac5bd0..02a1136ffe 100644 --- a/lib/blocs/file_share/file_share_cubit.dart +++ b/lib/blocs/file_share/file_share_cubit.dart @@ -45,9 +45,6 @@ class FileShareCubit extends Cubit { if (dataTxStatus == TransactionStatus.failed) { emit(FileShareLoadedFailedFile()); return; - } else if (dataTxStatus == TransactionStatus.pending) { - emit(FileShareLoadedPendingFile()); - return; } late Uri fileShareLink; @@ -87,6 +84,7 @@ class FileShareCubit extends Cubit { fileName: file.name, fileShareLink: fileShareLink, isPublicFile: drive.isPublic, + isPending: dataTxStatus == TransactionStatus.pending, ), ); } diff --git a/lib/blocs/file_share/file_share_state.dart b/lib/blocs/file_share/file_share_state.dart index 6bab74e769..5fb13bd996 100644 --- a/lib/blocs/file_share/file_share_state.dart +++ b/lib/blocs/file_share/file_share_state.dart @@ -25,10 +25,13 @@ class FileShareLoadSuccess extends FileShareState { /// Whether or not this file is public ie. not encrypted on the network. final bool isPublicFile; + final bool isPending; + const FileShareLoadSuccess({ required this.fileName, required this.fileShareLink, required this.isPublicFile, + required this.isPending, }); @override diff --git a/lib/components/file_share_dialog.dart b/lib/components/file_share_dialog.dart index 6c38d2d859..c14ddc5776 100644 --- a/lib/components/file_share_dialog.dart +++ b/lib/components/file_share_dialog.dart @@ -59,9 +59,35 @@ class FileShareDialogState extends State { const Center(child: CircularProgressIndicator()) else if (state is FileShareLoadedFailedFile) Text(appLocalizationsOf(context).shareFailedFile) - else if (state is FileShareLoadedPendingFile) - Text(appLocalizationsOf(context).sharePendingFile) else if (state is FileShareLoadSuccess) ...{ + if (state.isPending) + Padding( + padding: const EdgeInsets.only(bottom: 8.0), + child: Row( + children: [ + ArDriveIcons.triangle( + color: ArDriveTheme.of(context) + .themeData + .colors + .themeWarningEmphasis, + ), + const SizedBox( + width: 8, + ), + Flexible( + child: Text( + 'Warning: This file is currently pending and may not be immediately accessible.', + style: ArDriveTypography.body.buttonNormalBold( + color: ArDriveTheme.of(context) + .themeData + .colors + .themeWarningEmphasis, + ), + ), + ), + ], + ), + ), Row( crossAxisAlignment: CrossAxisAlignment.center, children: [