mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-23 13:05:12 +00:00
DirectoryView: Don't push same path twice to history
When opening a path, check if it's the current one before pushing it twice to the path history.
This commit is contained in:
parent
579975fd1e
commit
27091d05ee
Notes:
sideshowbarker
2024-07-19 17:35:51 +09:00
Author: https://github.com/anpep Commit: https://github.com/SerenityOS/serenity/commit/27091d05ee3 Pull-request: https://github.com/SerenityOS/serenity/pull/1886
1 changed files with 4 additions and 0 deletions
|
@ -206,6 +206,10 @@ void DirectoryView::add_path_to_history(const StringView& path)
|
|||
|
||||
void DirectoryView::open(const StringView& path)
|
||||
{
|
||||
if (model().root_path() == path) {
|
||||
model().update();
|
||||
return;
|
||||
}
|
||||
add_path_to_history(path);
|
||||
model().set_root_path(path);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue