1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:48:10 +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:
angel 2020-04-19 18:21:02 +02:00 committed by Andreas Kling
parent 579975fd1e
commit 27091d05ee

View file

@ -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);
}