1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 23:27:43 +00:00

Browser: Don't add multiple page reloads to history

When reloading a page multiple times, it was also added multiple
times to the history. This commit prohibits an url to be added
twice in a row.

Fixes #7264

Co-authored-by: Linus Groh <mail@linusgroh.de>
This commit is contained in:
Marcus Nilsson 2021-05-18 23:28:41 +02:00 committed by Linus Groh
parent 598d7f4127
commit 7aaef8fd4b

View file

@ -20,6 +20,8 @@ void History::dump() const
void History::push(const URL& url)
{
if (!m_items.is_empty() && m_items[m_current] == url)
return;
m_items.shrink(m_current + 1);
m_items.append(url);
m_current++;