diff --git a/app/containers/message/Blocks.js b/app/containers/message/Blocks.js
index 76a5e273..ba74ebe2 100644
--- a/app/containers/message/Blocks.js
+++ b/app/containers/message/Blocks.js
@@ -6,8 +6,7 @@ const Blocks = React.memo(({
blocks, id: mid, rid, blockAction
}) => {
if (blocks && blocks.length > 0) {
- const [, secondBlock] = blocks;
- const { appId = '' } = secondBlock;
+ const appId = blocks[0]?.appId || '';
return React.createElement(
messageBlockWithContext({
action: async({ actionId, value, blockId }) => {
diff --git a/app/views/ModalBlockView.js b/app/views/ModalBlockView.js
index e00c8493..3c6314e2 100644
--- a/app/views/ModalBlockView.js
+++ b/app/views/ModalBlockView.js
@@ -67,7 +67,7 @@ class ModalBlockView extends React.Component {
return {
title: textParser([title]),
...themedHeader(theme),
- headerLeft: (
+ headerLeft: close ? (
- ),
- headerRight: (
+ ) : null,
+ headerRight: submit ? (
- )
+ ) : null
};
}
@@ -136,7 +136,7 @@ class ModalBlockView extends React.Component {
const { navigation } = this.props;
const oldData = prevProps.navigation.getParam('data', {});
const newData = navigation.getParam('data', {});
- if (!isEqual(oldData, newData)) {
+ if (oldData.viewId !== newData.viewId) {
navigation.push('ModalBlockView', { data: newData });
}
}
@@ -148,12 +148,14 @@ class ModalBlockView extends React.Component {
}
handleUpdate = ({ type, ...data }) => {
+ const { navigation } = this.props;
if ([MODAL_ACTIONS.ERRORS].includes(type)) {
const { errors } = data;
this.setState({ errors });
} else {
this.setState({ data });
}
+ navigation.setParams({ data });
};
cancel = async({ closeModal }) => {