1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 08:54:58 +00:00

Ladybird: Do not enable the reload button if history is empty

Not much of an issue currently, but will be once tabs are used to render
plain HTML.
This commit is contained in:
Timothy Flynn 2023-08-28 15:54:36 -04:00 committed by Tim Flynn
parent 70830b711e
commit 9c4ce1b80b
5 changed files with 19 additions and 0 deletions

View file

@ -132,6 +132,7 @@ Tab::Tab(BrowserWindow* window, StringView webdriver_content_ipc_path, WebView::
m_window->go_back_action().setEnabled(m_history.can_go_back());
m_window->go_forward_action().setEnabled(m_history.can_go_forward());
m_window->reload_action().setEnabled(!m_history.is_empty());
if (m_inspector_widget)
m_inspector_widget->clear_dom_json();
@ -587,6 +588,9 @@ void Tab::forward()
void Tab::reload()
{
if (m_history.is_empty())
return;
m_is_history_navigation = true;
view().load(m_history.current().url.to_deprecated_string());
}