fixed overwrite on internal copy, DST drift in widget anchors, inline errors without controller and removed dead room lookup
This commit is contained in:
@@ -7,8 +7,8 @@ import 'remote_file_ref.dart';
|
||||
|
||||
/// Server-side WebDAV copy of [source] into [targetFolderPath]. On a 412
|
||||
/// conflict the user is asked whether to overwrite; on confirmation the call
|
||||
/// is retried with `overwrite: true`. Returns true when the file ended up at
|
||||
/// the target, false when the user cancelled.
|
||||
/// is retried with `overwrite: true` inside the dialog. Returns true when the
|
||||
/// file ended up at the target, false when the user cancelled.
|
||||
Future<bool> copyRemoteFileTo({
|
||||
required BuildContext context,
|
||||
required RemoteFileRef source,
|
||||
@@ -27,19 +27,11 @@ Future<bool> copyRemoteFileTo({
|
||||
} on DynamiteApiException catch (e) {
|
||||
if (e.statusCode != 412) rethrow;
|
||||
if (!context.mounted) return false;
|
||||
final overwrite = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (ctx) => ConfirmDialog(
|
||||
title: 'Datei existiert bereits',
|
||||
content:
|
||||
'"${source.name}" existiert in /$targetFolderPath. Überschreiben?',
|
||||
confirmButton: 'Überschreiben',
|
||||
cancelButton: 'Abbrechen',
|
||||
onConfirm: () => Navigator.of(ctx).pop(true),
|
||||
),
|
||||
);
|
||||
if (overwrite != true) return false;
|
||||
await webdav.copy(src, dstUri, overwrite: true);
|
||||
return true;
|
||||
return ConfirmDialog(
|
||||
title: 'Datei existiert bereits',
|
||||
content: '"${source.name}" existiert in /$targetFolderPath. Überschreiben?',
|
||||
confirmButton: 'Überschreiben',
|
||||
onConfirmAsync: () => webdav.copy(src, dstUri, overwrite: true),
|
||||
).ask(context);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user