Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Fix zoom level resetting on page nav
Browse files Browse the repository at this point in the history
Fix #1451

Auditors: @aekeus
  • Loading branch information
bbondy committed Apr 25, 2016
1 parent 1ef3cee commit e03b38a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions js/components/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,6 @@ class Frame extends ImmutableComponent {

componentDidMount () {
this.updateWebview()
if (this.zoomLevel !== config.zoom.defaultValue) {
// Timeout to work around setting zoom too early not working in Electron
setTimeout(() => this.webview.setZoomLevel(this.zoomLevel), 1000)
setTimeout(() => this.webview.setZoomLevel(this.zoomLevel), 2000)
}
}

zoom (stepSize) {
Expand Down Expand Up @@ -342,6 +337,10 @@ class Frame extends ImmutableComponent {
this.props.frame,
this.webview.canGoBack(),
this.webview.canGoForward())
if (this.zoomLevel !== config.zoom.defaultValue) {
// Timeout to work around setting zoom too early not working in Electron
this.webview.setZoomLevel(this.zoomLevel)
}
}
const loadEnd = () => {
windowActions.onWebviewLoadEnd(
Expand Down

0 comments on commit e03b38a

Please sign in to comment.