diff --git a/app/views/AttachmentView.js b/app/views/AttachmentView.js
index f00a69dc5..39cd304f1 100644
--- a/app/views/AttachmentView.js
+++ b/app/views/AttachmentView.js
@@ -27,22 +27,6 @@ const styles = StyleSheet.create({
});
class AttachmentView extends React.Component {
- static navigationOptions = ({ navigation, route }) => {
- const attachment = route.params?.attachment;
- const from = route.params?.from;
- const handleSave = route.params?.handleSave ?? (() => {});
- const { title } = attachment;
- const options = {
- title: decodeURI(title),
- headerRight: () =>
- };
- if (from !== 'MessagesView') {
- options.gesturesEnabled = false;
- options.headerLeft = () => ;
- }
- return options;
- }
-
static propTypes = {
navigation: PropTypes.object,
route: PropTypes.object,
@@ -58,12 +42,11 @@ class AttachmentView extends React.Component {
super(props);
const attachment = props.route.params?.attachment;
this.state = { attachment, loading: true };
+ this.setHeader();
}
componentDidMount() {
const { navigation } = this.props;
- navigation.setParams({ handleSave: this.handleSave });
-
this.unsubscribeBlur = navigation.addListener('blur', () => {
if (this.videoRef && this.videoRef.stopAsync) {
this.videoRef.stopAsync();
@@ -77,6 +60,22 @@ class AttachmentView extends React.Component {
}
}
+ setHeader = () => {
+ const { route, navigation } = this.props;
+ const attachment = route.params?.attachment;
+ const from = route.params?.from;
+ const { title } = attachment;
+ const options = {
+ title: decodeURI(title),
+ headerRight: () =>
+ };
+ if (from !== 'MessagesView') {
+ options.gesturesEnabled = false;
+ options.headerLeft = () => ;
+ }
+ navigation.setOptions(options);
+ }
+
getVideoRef = ref => this.videoRef = ref;
handleSave = async() => {