Skip to content

Commit

Permalink
Fix: Fixed COMException in LoadPaneChanged (#14628)
Browse files Browse the repository at this point in the history
Co-authored-by: hishitetsu <66369541+hishitetsu@users.noreply.github.com>
  • Loading branch information
yaira2 and hishitetsu committed Feb 2, 2024
1 parent 1250146 commit 59f56a5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Files.App/Views/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,8 @@ private void LoadPaneChanged()
{
var isHomePage = !(SidebarAdaptiveViewModel.PaneHolder?.ActivePane?.InstanceViewModel?.IsPageTypeNotHome ?? false);
var isMultiPane = SidebarAdaptiveViewModel.PaneHolder?.IsMultiPaneActive ?? false;
var isBigEnough = MainWindow.Instance.Bounds.Width > 450 && MainWindow.Instance.Bounds.Height > 450 || RootGrid.ActualWidth > 700 && MainWindow.Instance.Bounds.Height > 360;
var isBigEnough = !App.AppModel.IsMainWindowClosed &&
(MainWindow.Instance.Bounds.Width > 450 && MainWindow.Instance.Bounds.Height > 450 || RootGrid.ActualWidth > 700 && MainWindow.Instance.Bounds.Height > 360);

ViewModel.ShouldPreviewPaneBeDisplayed = (!isHomePage || isMultiPane) && isBigEnough;
ViewModel.ShouldPreviewPaneBeActive = UserSettingsService.InfoPaneSettingsService.IsEnabled && ViewModel.ShouldPreviewPaneBeDisplayed;
Expand Down

0 comments on commit 59f56a5

Please sign in to comment.