Skip to content
This repository was archived by the owner on Dec 25, 2022. It is now read-only.

Commit 820e093

Browse files
Baitinqgunnarbeutner
authored andcommitted
Fix reloading functionality
Previously, reloading went back to the first page loaded by WebView::load() or WebView::load_html(), as they are the only methods that modify m_url, which is what the reload loaded. Now we handle reloads in Tab.cpp by simply loading the last entry in the m_history.
1 parent f0f2dce commit 820e093

File tree

3 files changed

+2
-7
lines changed

3 files changed

+2
-7
lines changed

Tab.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ void Tab::home()
159159

160160
void Tab::reload()
161161
{
162-
view().reload();
162+
m_is_history_navigation = true;
163+
view().load(m_history.current().url.to_string());
163164
}
164165

165166
void Tab::location_edit_return_pressed()

WebContentView.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,6 @@ WebContentView::~WebContentView()
7979
{
8080
}
8181

82-
void WebContentView::reload()
83-
{
84-
load(m_url);
85-
}
86-
8782
void WebContentView::load(AK::URL const& url)
8883
{
8984
m_url = url;

WebContentView.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ class WebContentView final
5353

5454
void load(AK::URL const&);
5555
void load_html(StringView html, AK::URL const&);
56-
void reload();
5756

5857
Function<void(Gfx::IntPoint const& screen_position)> on_context_menu_request;
5958
Function<void(const AK::URL&, String const& target, unsigned modifiers)> on_link_click;

0 commit comments

Comments
 (0)