Skip to content

Commit 9f6f55f

Browse files
authored
Code Quality: Fixed an issue where folder selection dialog wouldn't work (#15553)
1 parent 2ad172c commit 9f6f55f

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed

src/Files.App/ViewModels/Dialogs/DecompressArchiveDialogViewModel.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using System.IO;
55
using System.Windows.Input;
66
using Windows.Storage;
7-
using Windows.Storage.Pickers;
87

98
namespace Files.App.ViewModels.Dialogs
109
{
@@ -14,7 +13,7 @@ public sealed class DecompressArchiveDialogViewModel : ObservableObject
1413

1514
private readonly IStorageFile archive;
1615

17-
public StorageFolder DestinationFolder { get; private set; }
16+
public BaseStorageFolder DestinationFolder { get; private set; }
1817

1918
private string destinationFolderPath;
2019
public string DestinationFolderPath
@@ -64,7 +63,7 @@ private async Task SelectDestinationAsync()
6463
{
6564
CommonDialogService.Open_FileOpenDialog(MainWindow.Instance.WindowHandle, true, [], Environment.SpecialFolder.Desktop, out var filePath);
6665

67-
DestinationFolder = await StorageHelpers.ToStorageItem<StorageFolder>(filePath);
66+
DestinationFolder = await StorageHelpers.ToStorageItem<BaseStorageFolder>(filePath);
6867
DestinationFolderPath = (DestinationFolder is not null) ? DestinationFolder.Path : DefaultDestinationFolderPath();
6968
}
7069

src/Files.App/Views/Properties/LibraryPage.xaml.cs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,10 @@
11
// Copyright (c) 2024 Files Community
22
// Licensed under the MIT License. See the LICENSE.
33

4-
using CommunityToolkit.Mvvm.ComponentModel;
5-
using CommunityToolkit.Mvvm.Input;
6-
using Files.App.Utils;
7-
using Files.App.Helpers;
84
using Files.App.ViewModels.Properties;
95
using Microsoft.UI.Xaml;
10-
using Microsoft.UI.Xaml.Controls;
11-
using System;
12-
using System.Collections.ObjectModel;
13-
using System.ComponentModel;
14-
using System.Linq;
156
using System.Runtime.CompilerServices;
16-
using System.Threading.Tasks;
177
using System.Windows.Input;
18-
using Windows.Storage.Pickers;
19-
using Windows.Storage;
208

219
namespace Files.App.Views.Properties
2210
{
@@ -107,7 +95,7 @@ private async Task AddLocationAsync()
10795
if (!result)
10896
return;
10997

110-
var folder = await StorageHelpers.ToStorageItem<StorageFile>(filePath);
98+
var folder = await StorageHelpers.ToStorageItem<BaseStorageFolder>(filePath);
11199
if (folder is not null && !Folders.Any((f) => string.Equals(folder.Path, f.Path, StringComparison.OrdinalIgnoreCase)))
112100
{
113101
bool isDefault = Folders.Count == 0;

0 commit comments

Comments
 (0)