Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion lib/app/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import 'package:fula_files/features/settings/providers/settings_provider.dart';
import 'package:fula_files/features/onboarding/screens/terms_of_service_screen.dart';
import 'package:fula_files/features/sharing/widgets/create_collaboration_dialog.dart';
import 'package:fula_files/features/sharing/widgets/create_share_dialog.dart';
import 'package:fula_files/shared/widgets/beta_upload_dialog.dart';
import 'package:fula_files/shared/widgets/keyboard_shortcuts.dart';
import 'package:fula_files/shared/widgets/mini_player.dart';

Expand Down Expand Up @@ -373,6 +374,12 @@ class _FulaFilesAppState extends ConsumerState<FulaFilesApp>
filePath: filePath,
);
if (!confirmed) return;
final betaCtx = walletNavigatorKey.currentContext;
if (betaCtx == null ||
!betaCtx.mounted ||
!await showBetaUploadDialog(betaCtx)) {
return;
}

final name = filePath.split(Platform.pathSeparator).last;

Expand Down Expand Up @@ -763,7 +770,10 @@ class _FulaFilesAppState extends ConsumerState<FulaFilesApp>
builder: (context, child) {
// Show ToS screen if not accepted
if (!tosAccepted) {
return TermsOfServiceScreen(onAccepted: _onTosAccepted);
return TermsOfServiceScreen(
onAccepted: _onTosAccepted,
isUpdate: settings.tosAcceptedBefore,
);
}

return DesktopKeyboardShortcuts(
Expand Down
5 changes: 5 additions & 0 deletions lib/features/apps/screens/whatsapp_backup_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import 'package:fula_files/core/services/whatsapp_backup_service.dart';
import 'package:fula_files/features/apps/providers/app_provider.dart';
import 'package:fula_files/features/apps/widgets/password_setup_dialog.dart';
import 'package:fula_files/shared/utils/adaptive_ui.dart';
import 'package:fula_files/shared/widgets/beta_upload_dialog.dart';

String _formatTimeAgo(DateTime dateTime) {
final diff = DateTime.now().difference(dateTime);
Expand Down Expand Up @@ -223,6 +224,10 @@ class _WhatsAppBackupScreenState extends ConsumerState<WhatsAppBackupScreen> {
overrideDir = Directory(activated!.iosFolderPath!);
}

// A backup uploads the chats and their media.
if (!context.mounted || !await showBetaUploadDialog(context)) return;
if (!context.mounted) return;

ref.read(appProvider.notifier).startBackup(
widget.appId,
overrideDir: overrideDir,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,12 @@ class _AutomateTaskDetailScreenState
// (the same dialog the website-generation flow shows when
// pinning files to IPFS) — different from the bulk-send
// click-to-chat disclaimer we just showed above.
final ipfsOk = await ipfs_warning.showLegalDisclaimerDialog(context);
// The user's own attachment is being published, not generated
// content — so the beta box carries the upload wording.
final ipfsOk = await ipfs_warning.showLegalDisclaimerDialog(
context,
betaAcknowledgement: ipfs_warning.kBetaUploadAcknowledgement,
);
if (ipfsOk != true) {
// User declined the IPFS warning — abort run; don't send
// ANY rows (the attachment is required for the {File}
Expand Down
13 changes: 12 additions & 1 deletion lib/features/browser/screens/file_browser_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import 'package:fula_files/core/services/legacy_listing_cache.dart';
import 'package:fula_files/core/utils/user_id.dart';
import 'package:fula_files/core/utils/safe_path.dart';
import 'package:file_picker/file_picker.dart';
import 'package:fula_files/shared/widgets/beta_upload_dialog.dart';
import 'package:fula_files/shared/widgets/master_health_banner.dart';
import 'package:fula_files/core/models/file_tag.dart';
import 'package:fula_files/core/models/local_file.dart';
Expand Down Expand Up @@ -2150,8 +2151,9 @@ class _FileBrowserScreenState extends ConsumerState<FileBrowserScreen> {
leading: Icon(LucideIcons.upload, color: isLoggedIn ? null : Colors.grey),
title: Text('Upload to Cloud', style: TextStyle(color: isLoggedIn ? null : Colors.grey)),
subtitle: isLoggedIn ? null : const Text('Sign in required', style: TextStyle(fontSize: 12)),
onTap: isLoggedIn ? () {
onTap: isLoggedIn ? () async {
Navigator.pop(ctx);
if (!await showBetaUploadDialog(context) || !mounted) return;
_uploadFile(file);
} : null,
),
Expand Down Expand Up @@ -2396,6 +2398,8 @@ class _FileBrowserScreenState extends ConsumerState<FileBrowserScreen> {
}

Future<void> _uploadSelected() async {
// One notice for the whole selection, not one per file.
if (!await showBetaUploadDialog(context) || !mounted) return;
for (final path in _selectedFiles) {
final file = _files.firstWhere((f) => f.path == path);
await _uploadFile(file);
Expand Down Expand Up @@ -2539,6 +2543,8 @@ class _FileBrowserScreenState extends ConsumerState<FileBrowserScreen> {
}

Future<void> _enableCategorySync(FileCategory category) async {
// Turning sync on starts uploads the user will not confirm one by one.
if (!await showBetaUploadDialog(context) || !mounted) return;
try {
// Check battery optimization for background sync (Android)
if (Platform.isAndroid) {
Expand Down Expand Up @@ -2590,6 +2596,7 @@ class _FileBrowserScreenState extends ConsumerState<FileBrowserScreen> {
}

Future<void> _syncCategoryNow(FileCategory category) async {
if (!await showBetaUploadDialog(context) || !mounted) return;
try {
final syncPath = 'category:${widget.category}';
await FolderWatchService.instance.syncFolder(syncPath);
Expand Down Expand Up @@ -2697,6 +2704,8 @@ class _FileBrowserScreenState extends ConsumerState<FileBrowserScreen> {
}

Future<void> _enableFolderSync(LocalFile folder) async {
// Turning sync on starts uploads the user will not confirm one by one.
if (!await showBetaUploadDialog(context) || !mounted) return;
try {
// Check battery optimization for background sync (Android)
if (Platform.isAndroid) {
Expand Down Expand Up @@ -2772,6 +2781,7 @@ class _FileBrowserScreenState extends ConsumerState<FileBrowserScreen> {
}

Future<void> _syncFolderNow(LocalFile folder) async {
if (!await showBetaUploadDialog(context) || !mounted) return;
try {
await FolderWatchService.instance.syncFolder(folder.path);
if (mounted) {
Expand Down Expand Up @@ -2827,6 +2837,7 @@ class _FileBrowserScreenState extends ConsumerState<FileBrowserScreen> {
);

if (confirmed != true || !mounted) return;
if (!await showBetaUploadDialog(context) || !mounted) return;

ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
Expand Down
8 changes: 7 additions & 1 deletion lib/features/nft/screens/nft_detail_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:lucide_icons/lucide_icons.dart';
import 'package:path/path.dart' as p;
import 'package:path_provider/path_provider.dart';
import 'package:fula_files/core/models/file_tag.dart';
import 'package:fula_files/shared/widgets/beta_upload_dialog.dart';
import 'package:fula_files/core/models/local_file.dart';
import 'package:fula_files/core/models/nft_token.dart';
import 'package:fula_files/features/nft/providers/nft_provider.dart';
Expand Down Expand Up @@ -413,10 +414,15 @@ class _NftDetailScreenState extends ConsumerState<NftDetailScreen> {
return;
}

// Minting uploads the image and its metadata.
if (!await showBetaUploadDialog(context)) return;
final previewPath = await _resolveFilePath(localPath);
if (!mounted) return;

// Show mint config sheet (image preview + stepped config)
final config = await showMintConfigDialog(
context,
previewPath: await _resolveFilePath(localPath),
previewPath: previewPath,
defaultEventName: p.basenameWithoutExtension(firstFile.fileName),
);
if (config == null || !mounted) return;
Expand Down
Loading
Loading