Skip to content

Commit d408e5c

Browse files
authored
Check "permanently delete" automatically by pressing shift + Del (#904)
* Fix shift+delete
1 parent 411ad51 commit d408e5c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Files/Interacts/Interaction.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,11 @@ private async void Manager_DataRequested(DataTransferManager sender, DataRequest
507507
public async void DeleteItem_Click(object sender, RoutedEventArgs e)
508508
{
509509
var deleteFromRecycleBin = CurrentInstance.ViewModel.WorkingDirectory.StartsWith(App.AppSettings.RecycleBinPath);
510-
// Permanently delete if deleting from recycle bin
511-
App.InteractionViewModel.PermanentlyDelete = deleteFromRecycleBin ? StorageDeleteOption.PermanentDelete : StorageDeleteOption.Default;
510+
if (deleteFromRecycleBin)
511+
{
512+
// Permanently delete if deleting from recycle bin
513+
App.InteractionViewModel.PermanentlyDelete = StorageDeleteOption.PermanentDelete;
514+
}
512515

513516
if (App.AppSettings.ShowConfirmDeleteDialog == true) //check if the setting to show a confirmation dialog is on
514517
{
@@ -517,6 +520,7 @@ public async void DeleteItem_Click(object sender, RoutedEventArgs e)
517520

518521
if (dialog.Result != MyResult.Delete) //delete selected item(s) if the result is yes
519522
{
523+
App.InteractionViewModel.PermanentlyDelete = StorageDeleteOption.Default; //reset PermanentlyDelete flag
520524
return; //return if the result isn't delete
521525
}
522526
}

0 commit comments

Comments
 (0)