mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 06:27:35 +00:00
Help: Make sure the home page is actually shown when opening the app
Previously `open_page` was called multiple times when opening the application, once for the actual page, but also in `tree_view.on_selection_change`. At startup there is no valid selection yet, which caused an empty page to be loaded. Prevent this by early returning if the `path` is null.
This commit is contained in:
parent
9a9e7f03f2
commit
a5ecac5494
1 changed files with 3 additions and 0 deletions
|
@ -163,6 +163,9 @@ int main(int argc, char* argv[])
|
|||
|
||||
tree_view.on_selection_change = [&] {
|
||||
String path = model->page_path(tree_view.selection().first());
|
||||
if (path.is_null())
|
||||
return;
|
||||
|
||||
history.push(path);
|
||||
update_actions();
|
||||
open_page(path);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue