mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 04:13:11 +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
|
@ -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…
Reference in a new issue