From 2f3678d6e3a5e12fd6d589bd875d063a1f70d4c7 Mon Sep 17 00:00:00 2001 From: Pritesh Nandgaonkar Date: Wed, 13 Mar 2019 05:25:06 -0700 Subject: [PATCH] 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 --- src/PluginContainer.js | 13 ++++++------- src/plugins/crash_reporter/index.js | 1 + 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/PluginContainer.js b/src/PluginContainer.js index 0af6bf572..aa76973e5 100644 --- a/src/PluginContainer.js +++ b/src/PluginContainer.js @@ -101,13 +101,12 @@ class PluginContainer extends PureComponent { const props: PluginProps = { 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, diff --git a/src/plugins/crash_reporter/index.js b/src/plugins/crash_reporter/index.js index 293603631..b6d1ddbab 100644 --- a/src/plugins/crash_reporter/index.js +++ b/src/plugins/crash_reporter/index.js @@ -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