Skip to content

Commit

Permalink
Improve reloading
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruben2776 committed Nov 8, 2024
1 parent 0e12b8d commit 23ad33f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/PicView.Avalonia/Navigation/ErrorHandling.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,24 +73,24 @@ await Dispatcher.UIThread.InvokeAsync(() =>
return;
}

vm.ImageIterator?.Clear();

if (!NavigationHelper.CanNavigate(vm))
{
await FileHistoryNavigation.OpenLastFileAsync(vm);
return;
}

if (File.Exists(vm.FileInfo.FullName))
{
await NavigationHelper.LoadPicFromStringAsync(vm.FileInfo.FullName, vm);
}
else
if (vm.ImageIterator is null)
{
await Dispatcher.UIThread.InvokeAsync(() =>
{
ShowStartUpMenu(vm);
});
return;
}

vm.ImageIterator.Clear();
await vm.ImageIterator.ReloadFileList().ConfigureAwait(false);
var index = vm.ImageIterator.ImagePaths.IndexOf(vm.FileInfo.FullName);
await vm.ImageIterator.IterateToIndex(index).ConfigureAwait(false);
}
}

0 comments on commit 23ad33f

Please sign in to comment.