From 9aaf1f61a84658852896869e07adab65364f3d27 Mon Sep 17 00:00:00 2001 From: hishitetsu <66369541+hishitetsu@users.noreply.github.com> Date: Fri, 8 Mar 2024 22:18:44 +0900 Subject: [PATCH] Update BaseLayoutViewModel.cs --- .../ViewModels/Layouts/BaseLayoutViewModel.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Files.App/ViewModels/Layouts/BaseLayoutViewModel.cs b/src/Files.App/ViewModels/Layouts/BaseLayoutViewModel.cs index 117587d86618..ddd65381e8bc 100644 --- a/src/Files.App/ViewModels/Layouts/BaseLayoutViewModel.cs +++ b/src/Files.App/ViewModels/Layouts/BaseLayoutViewModel.cs @@ -170,8 +170,17 @@ public async Task DropAsync(DragEventArgs e) if (FilesystemHelpers.HasDraggedStorageItems(e.DataView)) { - await _associatedInstance.FilesystemHelpers.PerformOperationTypeAsync(e.AcceptedOperation, e.DataView, _associatedInstance.FilesystemViewModel.WorkingDirectory, false, true); - await _associatedInstance.RefreshIfNoWatcherExistsAsync(); + var deferral = e.GetDeferral(); + + try + { + await _associatedInstance.FilesystemHelpers.PerformOperationTypeAsync(e.AcceptedOperation, e.DataView, _associatedInstance.FilesystemViewModel.WorkingDirectory, false, true); + await _associatedInstance.RefreshIfNoWatcherExistsAsync(); + } + finally + { + deferral.Complete(); + } } }