mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-31 13:48:25 +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:
committed by
Ali Mohammad Pur
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);
|
||||
|
||||
Reference in New Issue
Block a user