Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async componentDidMount() {
let status = '';
const component = this;
const crashesEnabled = await Crashes.isEnabled();
component.setState({ crashesEnabled });
const crashedInLastSession = await Crashes.hasCrashedInLastSession();
status += `Crashed: ${crashedInLastSession ? 'yes' : 'no'}\n\n`;
component.setState({ lastSessionStatus: status });
if (crashedInLastSession) {
const crashReport = await Crashes.lastSessionCrashReport();
status += JSON.stringify(crashReport, null, 4);
component.setState({ lastSessionStatus: status });
}
}
toggle: async () => {
await Crashes.setEnabled(!this.state.crashesEnabled);
const crashesEnabled = await Crashes.isEnabled();
this.setState({ crashesEnabled });
}
},
async refreshToggle() {
const crashesEnabled = await Crashes.isEnabled();
this.setState({ crashesEnabled });
}
async componentDidMount() {
let status = '';
const component = this;
const crashesEnabled = await Crashes.isEnabled();
component.setState({ crashesEnabled });
const crashedInLastSession = await Crashes.hasCrashedInLastSession();
status += `Crashed: ${crashedInLastSession ? 'yes' : 'no'}\n\n`;
component.setState({ lastSessionStatus: status });
if (crashedInLastSession) {
const crashReport = await Crashes.lastSessionCrashReport();
status += JSON.stringify(crashReport, null, 4);
component.setState({ lastSessionStatus: status });
}
}
async componentDidMount() {
let status = "";
const component = this;
const crashesEnabled = await Crashes.isEnabled();
component.setState({ crashesEnabled });
const crashedInLastSession = await Crashes.hasCrashedInLastSession();
status += `Crashed: ${crashedInLastSession ? "yes" : "no"}\n\n`;
component.setState({ lastSessionStatus: status });
if (crashedInLastSession) {
const crashReport = await Crashes.lastSessionCrashReport();
status += JSON.stringify(crashReport, null, 4);
component.setState({ lastSessionStatus: status });
}
const textAttachmentValue = await AttachmentsProvider.getTextAttachment();
component.setState({ textAttachment: textAttachmentValue });
async refreshToggle() {
const crashesEnabled = await Crashes.isEnabled();
this.setState({ crashesEnabled });
}
async toggleEnabled() {
await Crashes.setEnabled(!this.state.crashesEnabled);
const crashesEnabled = await Crashes.isEnabled();
this.setState({ crashesEnabled });
}
async componentDidMount() {
let status = '';
const component = this;
const crashesEnabled = await Crashes.isEnabled();
component.setState({ crashesEnabled });
const crashedInLastSession = await Crashes.hasCrashedInLastSession();
status += `Crashed: ${crashedInLastSession ? 'yes' : 'no'}\n\n`;
component.setState({ lastSessionStatus: status });
if (crashedInLastSession) {
const crashReport = await Crashes.lastSessionCrashReport();
status += JSON.stringify(crashReport, null, 4);
component.setState({ lastSessionStatus: status });
}
const textAttachmentValue = await AttachmentsProvider.getTextAttachment();
component.setState({ textAttachment: textAttachmentValue });
async toggleEnabled() {
await Crashes.setEnabled(!this.state.crashesEnabled);
const crashesEnabled = await Crashes.isEnabled();
this.setState({ crashesEnabled });
}