Fix the regressed deeplink support for crash reporter plugin
Summary: The deeplink from crash notification to crash reporter plugin was broken. It always showed the latest crash.With this diff the crashreporter plugin shows the correct crash information. Reviewed By: danielbuechele Differential Revision: D13487792 fbshipit-source-id: eee6826bb0a84d0aab9b432a1c9a04aa7d528402
This commit is contained in:
committed by
Facebook Github Bot
parent
3135c99cc5
commit
ade6eabdb0
@@ -126,11 +126,22 @@ export default class CrashReporterPlugin extends FlipperDevicePlugin {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const crash =
|
let crash: ?Crash =
|
||||||
this.props.persistedState.crashes.length > 0 &&
|
this.props.persistedState.crashes.length > 0
|
||||||
this.props.persistedState.crashes[
|
? this.props.persistedState.crashes[
|
||||||
this.props.persistedState.crashes.length - 1
|
this.props.persistedState.crashes.length - 1
|
||||||
];
|
]
|
||||||
|
: null;
|
||||||
|
|
||||||
|
if (this.props.deepLinkPayload) {
|
||||||
|
const id = this.props.deepLinkPayload;
|
||||||
|
const index = this.props.persistedState.crashes.findIndex(elem => {
|
||||||
|
return elem.notificationID === Number(id);
|
||||||
|
});
|
||||||
|
if (index >= 0) {
|
||||||
|
crash = this.props.persistedState.crashes[index];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (crash) {
|
if (crash) {
|
||||||
const callstackString = crash.callstack;
|
const callstackString = crash.callstack;
|
||||||
@@ -162,7 +173,11 @@ export default class CrashReporterPlugin extends FlipperDevicePlugin {
|
|||||||
</CrashRow>
|
</CrashRow>
|
||||||
{this.device.os == 'Android' && (
|
{this.device.os == 'Android' && (
|
||||||
<CrashRow>
|
<CrashRow>
|
||||||
<Button onClick={() => this.openInLogs(crash.callstack)}>
|
<Button
|
||||||
|
onClick={() => {
|
||||||
|
//$FlowFixMe: checked that crash is not undefined
|
||||||
|
this.openInLogs(crash.callstack);
|
||||||
|
}}>
|
||||||
Open in Logs
|
Open in Logs
|
||||||
</Button>
|
</Button>
|
||||||
</CrashRow>
|
</CrashRow>
|
||||||
|
|||||||
Reference in New Issue
Block a user