Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async refreshUI() {
const appCenterEnabled = await AppCenter.isEnabled();
this.setState({ appCenterEnabled });
const authEnabled = await Auth.isEnabled();
this.setState({ authEnabled });
const pushEnabled = await Push.isEnabled();
this.setState({ pushEnabled });
const installId = await AppCenter.getInstallId();
this.setState({ installId });
}
async refreshUI() {
const appCenterEnabled = await AppCenter.isEnabled();
this.setState({ appCenterEnabled });
const authEnabled = await Auth.isEnabled();
this.setState({ authEnabled });
const pushEnabled = await Push.isEnabled();
this.setState({ pushEnabled });
const installId = await AppCenter.getInstallId();
this.setState({ installId });
}
async componentDidMount() {
const component = this;
const pushEnabled = await Push.isEnabled();
component.setState({ pushEnabled });
}
toggle: async () => {
await Push.setEnabled(!this.state.pushEnabled);
const pushEnabled = await Push.isEnabled();
this.setState({ pushEnabled });
}
},
async componentDidMount() {
const component = this;
const pushEnabled = await Push.isEnabled();
component.setState({ pushEnabled });
}
async toggleEnabled() {
await Push.setEnabled(!this.state.pushEnabled);
const pushEnabled = await Push.isEnabled();
this.setState({ pushEnabled });
}
async toggleEnabled() {
await Push.setEnabled(!this.state.pushEnabled);
const pushEnabled = await Push.isEnabled();
this.setState({ pushEnabled });
}
async toggleEnabled() {
await Push.setEnabled(!this.state.pushEnabled);
const pushEnabled = await Push.isEnabled();
this.setState({ pushEnabled });
}
async componentDidMount() {
const component = this;
const pushEnabled = await Push.isEnabled();
component.setState({ pushEnabled });
}