The Wayback Machine - https://web.archive.org/web/20240110153633/https://github.com/files-community/Files/pull/14045
Skip to content
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

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

d2dyno1
Copy link
Member

@d2dyno1 d2dyno1 commented Nov 23, 2023

Resolved / Related Issues

  • Were these changes approved in an issue or discussion with the project maintainers? In order to prevent extra work, feature requests and changes to the codebase must be approved before the pull request will be reviewed. This prevents extra work for the contributors and maintainers.
    Closes Bug: DirectoryNotFoundException in PinToStartAction #13947

Validation
How did you test these changes?

  • Did you build the app and test your changes?
Comment on lines 40 to 44
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);
Copy link
Contributor

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed

Comment on lines 36 to 41
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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above.

@d2dyno1
Copy link
Member Author

d2dyno1 commented Dec 26, 2023

It crashes again when keeping it in background 😭

@hishitetsu
Copy link
Contributor

It crashes again when keeping it in background 😭

When I tried it, nothing content was displayed in the first place...

Comment on lines 38 to +41
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];
Copy link
Contributor

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.

@d2dyno1
Copy link
Member Author

d2dyno1 commented Jan 4, 2024

I'll work on it more tomorrow 🙂

@d2dyno1
Copy link
Member Author

d2dyno1 commented Jan 8, 2024

Some progress: there's no longer a crash when resuming from background, however the app content stays empty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants