|
@@ -169,6 +169,10 @@ const ChatScreen = ({ route }: { route: any }) => {
|
|
|
};
|
|
|
|
|
|
useEffect(() => {
|
|
|
+ if (!Audio || !Audio.setAudioModeAsync) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
Audio.setAudioModeAsync({
|
|
|
allowsRecordingIOS: false,
|
|
|
staysActiveInBackground: false,
|
|
@@ -1411,6 +1415,23 @@ const ChatScreen = ({ route }: { route: any }) => {
|
|
|
},
|
|
|
{
|
|
|
onSuccess: (res) => {
|
|
|
+ if (res.need_authentication_or_friend === 1) {
|
|
|
+ setModalInfo({
|
|
|
+ visible: true,
|
|
|
+ type: 'success',
|
|
|
+ message:
|
|
|
+ 'Only legit NomadManias and friends can send messages.\nBefriend this traveller first or become Legit!',
|
|
|
+ action: () =>
|
|
|
+ Linking.openURL('https://nomadmania.com/blog-authentication/').catch((err) =>
|
|
|
+ console.error('Failed to open auth URL:', err)
|
|
|
+ ),
|
|
|
+ buttonTitle: 'OK',
|
|
|
+ title: 'Oops!'
|
|
|
+ });
|
|
|
+
|
|
|
+ setMessages((messages ?? []).filter((msg) => msg._id === message._id));
|
|
|
+ return;
|
|
|
+ }
|
|
|
const newMessage = {
|
|
|
_id: res.message_id,
|
|
|
text: message.text,
|