From 0b946da96dec3ce1a43f870f3e2ed863a7bcda2d Mon Sep 17 00:00:00 2001 From: Sadaqat Ali Date: Sun, 19 Jun 2022 21:59:21 +0500 Subject: [PATCH] save beneficiaries to redux from draft meta --- src/screens/editor/container/editorContainer.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/screens/editor/container/editorContainer.tsx b/src/screens/editor/container/editorContainer.tsx index a1b151445..a7abeda50 100644 --- a/src/screens/editor/container/editorContainer.tsx +++ b/src/screens/editor/container/editorContainer.tsx @@ -86,7 +86,7 @@ class EditorContainer extends Component { // Component Life Cycle Functions componentDidMount() { this._isMounted = true; - const { currentAccount, navigation } = this.props; + const { currentAccount, navigation, dispatch } = this.props; const username = currentAccount && currentAccount.name ? currentAccount.name : ''; let isReply; let draftId; @@ -111,12 +111,15 @@ class EditorContainer extends Component { thumbIndex: draftThumbIndex, }) } - // load beneficiaries and rewards data from meta data of draft + // load beneficiaries and rewards data from meta field of draft if(_draft.meta && _draft.meta.rewardType){ this.setState({ rewardType: _draft.meta.rewardType }) } + if(_draft._id && _draft.meta && _draft.meta.beneficiaries){ + dispatch(setBeneficiaries(_draft._id || TEMP_BENEFICIARIES_ID, _draft.meta.beneficiaries)); + } this.setState({ draftId: _draft._id, isDraft: true, @@ -1233,8 +1236,6 @@ class EditorContainer extends Component { } = this.state; const tags = navigation.state.params && navigation.state.params.tags; -console.log('this.state.rewardType', this.state.rewardType); - return (