diff --git a/src/plugins/layout/layout2/index.js b/src/plugins/layout/layout2/index.js index f91c11e0e..29f50e8ba 100644 --- a/src/plugins/layout/layout2/index.js +++ b/src/plugins/layout/layout2/index.js @@ -85,6 +85,10 @@ export default class Layout extends FlipperPlugin { }; init() { + if (!this.props.persistedState) { + // If the selected plugin from the previous session was layout, then while importing the flipper trace, the redux store doesn't get updated in the first render, due to which the plugin crashes, as it has no persisted state + this.props.setPersistedState(this.constructor.defaultPersistedState); + } // persist searchActive state when moving between plugins to prevent multiple // TouchOverlayViews since we can't edit the view heirarchy in onDisconnect this.client.call('isSearchActive').then(({isSearchActive}) => {