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() {
await this.refreshToggle();
const crashedInLastSession = await Crashes.hasCrashedInLastSession();
const lastSessionStatus = crashedInLastSession ? 'Crashed' : 'OK';
this.setState({ lastSessionStatus });
if (crashedInLastSession) {
const crashReport = await Crashes.lastSessionCrashReport();
const crashReportString = JSON.stringify(crashReport, null, 4);
console.log('App crashed in the last session. Crashes.lastSessionCrashReport(): ', crashReportString);
}
const hasReceivedMemoryWarning = await Crashes.hasReceivedMemoryWarningInLastSession();
const memoryWarning = hasReceivedMemoryWarning ? 'Received' : 'No';
this.setState({ memoryWarning });
const textAttachment = await AttachmentsProvider.getTextAttachment();
this.setState({ textAttachment });
async componentDidMount() {
await this.refreshToggle();
const crashedInLastSession = await Crashes.hasCrashedInLastSession();
const lastSessionStatus = crashedInLastSession ? 'Crashed' : 'OK';
this.setState({ lastSessionStatus });
if (crashedInLastSession) {
const crashReport = await Crashes.lastSessionCrashReport();
const crashReportString = JSON.stringify(crashReport, null, 4);
console.log('App crashed in the last session. Crashes.lastSessionCrashReport(): ', crashReportString);
}
const hasReceivedMemoryWarning = await Crashes.hasReceivedMemoryWarningInLastSession();
const memoryWarning = hasReceivedMemoryWarning ? 'Received' : 'No';
this.setState({ memoryWarning });
const textAttachment = await AttachmentsProvider.getTextAttachment();
this.setState({ textAttachment });
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 });
const binaryAttachmentValue = await AttachmentsProvider.getBinaryAttachmentInfo();
component.setState({ binaryAttachment: binaryAttachmentValue });
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 });
const binaryAttachmentValue = await AttachmentsProvider.getBinaryAttachmentInfo();
component.setState({ binaryAttachment: binaryAttachmentValue });
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 });
}
}