diff --git a/app/components/Login.jsx b/app/components/Login.jsx index 0433447539..e13c12bb3b 100644 --- a/app/components/Login.jsx +++ b/app/components/Login.jsx @@ -22,28 +22,24 @@ type State = { export default class Login extends Component { state = { hasPermissions: true }; - componentDidMount() { - this.checkPermissions(); + constructor(props) { + super(props); + this.checkPermissions = this.checkPermissions.bind(this); } - initialPermissionCheck = true; + componentWillMount() { + this.checkPermissions(); + // setInterval(this.checkPermissions, 1000); + } - checkPermissions() { - SendKeys.hasPermissions() - .then(v => { - if (!this.initialPermissionCheck && !v) { - dialog.showErrorBox( - 'Whoops!', - `UPR is still missing the required permissions. Please try again, or restart UPR Desktop.` - ); - Sentry.captureMessage('Check permissions failed', 'warning'); - } - this.initialPermissionCheck = false; - return this.setState({ hasPermissions: v }); - }) + async checkPermissions() { + const v = await SendKeys.hasPermissions() .catch(e => { console.error(e); + Sentry.captureException(e); }); + this.setState({ hasPermissions: v }); + return v; } macPermissionWarning() { @@ -58,8 +54,15 @@ export default class Login extends Component { title="Welcome to UPR" buttonTitle="Check Permissions" buttonActive - buttonOnClick={() => { - this.checkPermissions(); + buttonOnClick={async () => { + const v = await this.checkPermissions(); + if (!v) { + dialog.showErrorBox( + 'Whoops!', + `UPR is still missing the required permissions. Please try again, or restart UPR Desktop.` + ); + Sentry.captureMessage('Check permissions failed', 'warning'); + } }} >
@@ -70,7 +73,7 @@ export default class Login extends Component {

To allow this, open System Preferences then select Security & - Privacy. Make sure UPR is checked in the Automation tab. + Privacy. Make sure UPR is checked in both the Automation and Accessibility tabs.

@@ -83,12 +86,12 @@ export default class Login extends Component { } = this; return (
- Logo -
- Banner + Logo +
+ Banner

Universal Presenter Remote

- - + + {this.macPermissionWarning()}
); diff --git a/app/package.json b/app/package.json index 3469c30c73..1cc9bd1c1e 100644 --- a/app/package.json +++ b/app/package.json @@ -1,7 +1,7 @@ { "name": "upr-desktop", "productName": "Universal Presenter Remote", - "version": "1.2.0", + "version": "1.2.1", "description": "Control your presentations from any platform.", "main": "./main.prod.js", "author": { diff --git a/package.json b/package.json index 217ad4bbbd..9ef6282bcb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "upr-desktop", "productName": "Universal Presenter Remote", - "version": "1.2.0", + "version": "1.2.1", "description": "Control your presentations from any platform.", "scripts": { "build": "concurrently \"yarn build-main\" \"yarn build-renderer\"",