Skip to content

Commit 8d07991

Browse files
committed
fix(desktop-browser): retry the failed URL when hard reloading a load error
1 parent a067e41 commit 8d07991

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

‎apps/desktop/src/main/browser-agent/session.ts‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2013,12 +2013,14 @@ export function reloadPage(contents: WebContents): void {
20132013
}
20142014

20152015
/**
2016-
* Reloads past the HTTP cache, the browser's Shift-reload. A hung page takes
2017-
* the plain reload's recovery instead: its renderer must be restarted, since
2018-
* reloading it in place waits on the hung page.
2016+
* Reloads past the HTTP cache, the browser's Shift-reload. A failed or hung
2017+
* page takes the plain reload's recovery instead: a load error retries the
2018+
* URL that failed, which need not be the committed page, and a hung renderer
2019+
* must be restarted, since reloading it in place waits on the hung page.
20192020
*/
20202021
function hardReloadPage(contents: WebContents): void {
2021-
if (tabForContents(contents)?.pageIssue?.kind === 'unresponsive') {
2022+
const issue = tabForContents(contents)?.pageIssue
2023+
if (issue?.kind === 'load-error' || issue?.kind === 'unresponsive') {
20222024
reloadPage(contents)
20232025
return
20242026
}

0 commit comments

Comments
 (0)