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

Commit

Permalink
Remove another isFocused sync IPC
Browse files Browse the repository at this point in the history
Auditors: @bridiver
  • Loading branch information
bbondy committed Jan 24, 2017
1 parent c069eae commit 658dc43
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/components/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const {isFrameError} = require('../../app/common/lib/httpUtil')
const locale = require('../l10n')
const appConfig = require('../constants/appConfig')
const {getSiteSettingsForHostPattern} = require('../state/siteSettings')
const {currentWindowWebContents} = require('../../app/renderer/currentWindow')
const {currentWindowWebContents, isFocused} = require('../../app/renderer/currentWindow')
const windowStore = require('../stores/windowStore')
const appStoreRenderer = require('../stores/appStoreRenderer')
const siteSettings = require('../state/siteSettings')
Expand Down Expand Up @@ -667,7 +667,7 @@ class Frame extends ImmutableComponent {
if (this.frame.isEmpty()) {
return
}
if (e.active && currentWindowWebContents.isFocused()) {
if (e.active && isFocused()) {
windowActions.setFocusedFrame(this.frame)
}
if (e.active && !this.props.isActive) {
Expand Down

3 comments on commit 658dc43

@bridiver
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand this one. isFocused always has to make a sync ipc call because the focused state can't be cached, so doesn't caching currentWindowWebContents accomplish the same thing?

@bridiver
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forget it, I see what you did now

@bbondy
Copy link
Member Author

@bbondy bbondy commented on 658dc43 Jan 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.