Ladybird/Qt: Only update navigation buttons for current tab

This resolves a bug where if you opened a link in a new tab and quickly
went back to the original, the navigation buttons would update for the
new page shortly after.
This commit is contained in:
Jamie Mansfield 2024-07-13 12:57:06 +01:00 committed by Alexander Kalenik
parent 4c7ef01b44
commit 7abf47f4bf
Notes: sideshowbarker 2024-07-16 18:06:41 +09:00

View file

@ -905,6 +905,9 @@ void Tab::update_hover_label()
void Tab::update_navigation_buttons_state() void Tab::update_navigation_buttons_state()
{ {
if (m_window->current_tab() != this)
return;
m_window->go_back_action().setEnabled(m_can_navigate_back); m_window->go_back_action().setEnabled(m_can_navigate_back);
m_window->go_forward_action().setEnabled(m_can_navigate_forward); m_window->go_forward_action().setEnabled(m_can_navigate_forward);
} }