Skip to content

Commit

Permalink
Fix last path for save template being wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
Deadpikle committed Nov 7, 2024
1 parent 4ab879b commit 09cb1fb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions EasyBackupAvalonia/ViewModels/SetupBackupViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,15 @@ private async void SaveItemsToDisk()
if (GetTopLevel()?.StorageProvider is IStorageProvider { CanOpen: true } provider)
{
var lastSaveExists = File.Exists(_lastSaveFilePath);
var lastPath = lastSaveExists ? Path.GetFileName(_lastSaveFilePath) : "";
var lastFileName = lastSaveExists ? _lastSaveFilePath : "";
var lastFileName = lastSaveExists ? Path.GetFileName(_lastSaveFilePath) : "";
var lastPath = lastSaveExists ? _lastSaveFilePath : "";
var lastPathDirName = Path.GetDirectoryName(lastPath);
var suggestedStartLocation = await provider.TryGetFolderFromPathAsync(lastPathDirName);
var result = await provider.SaveFilePickerAsync(new FilePickerSaveOptions()
{
Title = "Choose Save Location",
SuggestedStartLocation = await provider.TryGetFolderFromPathAsync(lastPath),
SuggestedFileName = lastPath,
SuggestedStartLocation = suggestedStartLocation,
SuggestedFileName = lastFileName,
DefaultExtension = "*.ebf",
FileTypeChoices = new List<FilePickerFileType>()
{
Expand Down

0 comments on commit 09cb1fb

Please sign in to comment.