New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code Quality: Improved app startup routine 2 - Checkpoint 2 #14045
base: main
Are you sure you want to change the base?
Conversation
This reverts commit e5a41c3.
| var folder = await StorageService.GetFolderAsync(listedItem.ItemPath); | ||
| await StartMenuService.PinAsync(folder, listedItem.Name); | ||
| IStorable storable = listedItem.IsFolder switch | ||
| { | ||
| true => await StorageService.GetFolderAsync(listedItem.ItemPath), | ||
| _ => await StorageService.GetFileAsync(listedItem.ItemPath) | ||
| }; | ||
| await StartMenuService.PinAsync(storable, listedItem.Name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this fix should be separated from the others and merged immediately, because crashes on pinning are one of the most frequent crashes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed
| var folder = await StorageService.GetFolderAsync(listedItem.ItemPath); | ||
| await StartMenuService.UnpinAsync(folder); | ||
| IStorable storable = listedItem.IsFolder switch | ||
| { | ||
| true => await StorageService.GetFolderAsync(listedItem.ItemPath), | ||
| _ => await StorageService.GetFileAsync(listedItem.ItemPath) | ||
| }; | ||
| await StartMenuService.UnpinAsync(storable); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above.
|
It crashes again when keeping it in background 😭 |
When I tried it, nothing content was displayed in the first place... |
| if (value >= 0 && value < MainPageViewModel.AppInstances.Count) | ||
| { | ||
| Frame rootFrame = (Frame)MainWindow.Instance.Content; | ||
| var mainView = (MainPage)rootFrame.Content; | ||
| mainView.ViewModel.SelectedTabItem = MainPageViewModel.AppInstances[value]; | ||
| if (MainWindow.Instance.GetMainPage() is { } mainPage) | ||
| mainPage.ViewModel.SelectedTabItem = MainPageViewModel.AppInstances[value]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might as well combine the IF statements.
|
I'll work on it more tomorrow 🙂 |
|
Some progress: there's no longer a crash when resuming from background, however the app content stays empty |


Resolved / Related Issues
Closes Bug: DirectoryNotFoundException in PinToStartAction #13947
Validation
How did you test these changes?