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 toggleEnabled() {
await AppCenter.setEnabled(!this.state.appCenterEnabled);
const appCenterEnabled = await AppCenter.isEnabled();
this.setState({ appCenterEnabled });
}
async componentDidMount() {
const component = this;
const appCenterEnabled = await AppCenter.isEnabled();
component.setState({ appCenterEnabled });
const installId = await AppCenter.getInstallId();
component.setState({ installId });
const logLevel = await AppCenter.getLogLevel();
component.setState({ logLevel });
}
async componentDidMount() {
const component = this;
const appCenterEnabled = await AppCenter.isEnabled();
component.setState({ appCenterEnabled });
const installId = await AppCenter.getInstallId();
component.setState({ installId });
const logLevel = await AppCenter.getLogLevel();
component.setState({ logLevel });
}
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 });
}
toggle: async () => {
await AppCenter.setEnabled(!this.state.appCenterEnabled);
const appCenterEnabled = await AppCenter.isEnabled();
const authEnabled = await Auth.isEnabled();
const pushEnabled = await Push.isEnabled();
this.setState({ appCenterEnabled, authEnabled, pushEnabled });
}
},
async toggleEnabled() {
await AppCenter.setEnabled(!this.state.appCenterEnabled);
const appCenterEnabled = await AppCenter.isEnabled();
this.setState({ appCenterEnabled });
}
toggle: async () => {
await AppCenter.setEnabled(!this.state.appCenterEnabled);
const appCenterEnabled = await AppCenter.isEnabled();
const authEnabled = await Auth.isEnabled();
const pushEnabled = await Push.isEnabled();
this.setState({ appCenterEnabled, authEnabled, pushEnabled });
}
},
async toggleEnabled() {
await AppCenter.setEnabled(!this.state.appCenterEnabled);
const appCenterEnabled = await AppCenter.isEnabled();
this.setState({ appCenterEnabled });
}