mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:07:35 +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
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)
|
void DirectoryView::open(const StringView& path)
|
||||||
{
|
{
|
||||||
|
if (model().root_path() == path) {
|
||||||
|
model().update();
|
||||||
|
return;
|
||||||
|
}
|
||||||
add_path_to_history(path);
|
add_path_to_history(path);
|
||||||
model().set_root_path(path);
|
model().set_root_path(path);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue