Skip to content

Commit

Permalink
Fix a compatibility issue that Notifications API are not supported on…
Browse files Browse the repository at this point in the history
… iOS (#153)
  • Loading branch information
cheton committed Apr 6, 2017
1 parent b2e5e8c commit bf9f67f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/web/containers/Header/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,17 @@ class Header extends Component {
this.state = this.getInitialState();
}
getInitialState() {
let pushPermission = '';
try {
// Push.Permission.get() will throw an error if Push is not supported on this device
pushPermission = Push.Permission.get();
} catch (e) {
// Ignore
}

return {
workflowState: controller.workflowState,
pushPermission: Push.Permission.get(),
pushPermission: pushPermission,
commands: [],
runningTasks: [],
currentVersion: settings.version,
Expand Down

0 comments on commit bf9f67f

Please sign in to comment.