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> = {
|
const props: PluginProps<Object> = {
|
||||||
key: pluginKey,
|
key: pluginKey,
|
||||||
logger: this.props.logger,
|
logger: this.props.logger,
|
||||||
persistedState:
|
persistedState: activePlugin.defaultPersistedState
|
||||||
!isArchivedDevice && activePlugin.defaultPersistedState
|
? {
|
||||||
? {
|
...activePlugin.defaultPersistedState,
|
||||||
...activePlugin.defaultPersistedState,
|
...pluginState,
|
||||||
...pluginState,
|
}
|
||||||
}
|
: pluginState,
|
||||||
: pluginState,
|
|
||||||
setPersistedState: state => setPluginState({pluginKey, state}),
|
setPersistedState: state => setPluginState({pluginKey, state}),
|
||||||
target,
|
target,
|
||||||
deepLinkPayload: this.props.deepLinkPayload,
|
deepLinkPayload: this.props.deepLinkPayload,
|
||||||
|
|||||||
@@ -380,6 +380,7 @@ export default class CrashReporterPlugin extends FlipperDevicePlugin<
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
let crash: ?Crash =
|
let crash: ?Crash =
|
||||||
|
this.props.persistedState.crashes &&
|
||||||
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
|
||||||
|
|||||||
Reference in New Issue
Block a user