mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-10-23 03:31:56 +00:00
webview: Address deprecation of WebContents.goBack et al.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
@@ -184,8 +184,8 @@ export default class WebView {
|
||||
}
|
||||
|
||||
back(): void {
|
||||
if (this.getWebContents().canGoBack()) {
|
||||
this.getWebContents().goBack();
|
||||
if (this.getWebContents().navigationHistory.canGoBack()) {
|
||||
this.getWebContents().navigationHistory.goBack();
|
||||
this.focus();
|
||||
}
|
||||
}
|
||||
@@ -194,12 +194,15 @@ export default class WebView {
|
||||
const $backButton = document.querySelector(
|
||||
"#actions-container #back-action",
|
||||
)!;
|
||||
$backButton.classList.toggle("disable", !this.getWebContents().canGoBack());
|
||||
$backButton.classList.toggle(
|
||||
"disable",
|
||||
!this.getWebContents().navigationHistory.canGoBack(),
|
||||
);
|
||||
}
|
||||
|
||||
forward(): void {
|
||||
if (this.getWebContents().canGoForward()) {
|
||||
this.getWebContents().goForward();
|
||||
if (this.getWebContents().navigationHistory.canGoForward()) {
|
||||
this.getWebContents().navigationHistory.goForward();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user