Solve the bug when default state was not added
Summary:
Due to faulty condition default state was not being added in the persistedState, which casued the following bug.
{F153286217}
Reviewed By: danielbuechele
Differential Revision: D14425166
fbshipit-source-id: 557dc3717b650dae90dc44ad12970a684cecbf24
This commit is contained in:
committed by
Facebook Github Bot
parent
c2b6df7c3b
commit
2f3678d6e3
@@ -101,13 +101,12 @@ class PluginContainer extends PureComponent<Props> {
|
||||
const props: PluginProps<Object> = {
|
||||
key: pluginKey,
|
||||
logger: this.props.logger,
|
||||
persistedState:
|
||||
!isArchivedDevice && activePlugin.defaultPersistedState
|
||||
? {
|
||||
...activePlugin.defaultPersistedState,
|
||||
...pluginState,
|
||||
}
|
||||
: pluginState,
|
||||
persistedState: activePlugin.defaultPersistedState
|
||||
? {
|
||||
...activePlugin.defaultPersistedState,
|
||||
...pluginState,
|
||||
}
|
||||
: pluginState,
|
||||
setPersistedState: state => setPluginState({pluginKey, state}),
|
||||
target,
|
||||
deepLinkPayload: this.props.deepLinkPayload,
|
||||
|
||||
@@ -380,6 +380,7 @@ export default class CrashReporterPlugin extends FlipperDevicePlugin<
|
||||
|
||||
render() {
|
||||
let crash: ?Crash =
|
||||
this.props.persistedState.crashes &&
|
||||
this.props.persistedState.crashes.length > 0
|
||||
? this.props.persistedState.crashes[
|
||||
this.props.persistedState.crashes.length - 1
|
||||
|
||||
Reference in New Issue
Block a user