diff --git a/app/client/mobile/src/conversation/Conversation.tsx b/app/client/mobile/src/conversation/Conversation.tsx
index 86a58128..a2a7194a 100644
--- a/app/client/mobile/src/conversation/Conversation.tsx
+++ b/app/client/mobile/src/conversation/Conversation.tsx
@@ -6,6 +6,7 @@ import {Message} from '../message/Message';
import {Surface, Icon, Text, TextInput, IconButton, Divider} from 'react-native-paper';
import { ActivityIndicator } from 'react-native-paper';
import { Colors } from '../constants/Colors';
+import { Confirm } from '../confirm/Confirm';
const SCROLL_THRESHOLD = 16;
@@ -20,14 +21,40 @@ export type MediaAsset = {
export function Conversation({close}: {close: ()=>void}) {
const { state, actions } = useConversation();
const [ more, setMore ] = useState(false);
+ const [ alert, setAlert ] = useState(false);
+ const [ sending, setSending ] = useState(false);
const [ selected, setSelected ] = useState(null as null | string);
const thread = useRef();
-
const scrolled = useRef(false);
const contentHeight = useRef(0);
const contentLead = useRef(null);
const scrollOffset = useRef(0);
+ const alertParams = {
+ title: state.strings.error,
+ prompt: state.strings.tryAgain,
+ cancel: {
+ label: state.strings.close,
+ action: () => {
+ setAlert(false);
+ },
+ },
+ };
+
+ const sendMessage = async () => {
+console.log("CALLING SEND MESSAGE");
+ if (!sending) {
+ setSending(true);
+ try {
+ await actions.send();
+ } catch (err) {
+ console.log(err);
+ setAlert(true);
+ }
+ setSending(false);
+ }
+ }
+
const loadMore = async () => {
if (!more) {
setMore(true);
@@ -135,8 +162,13 @@ export function Conversation({close}: {close: ()=>void}) {
)}
+
-
+ actions.setMessage(value)}
+
+/>
@@ -146,7 +178,14 @@ export function Conversation({close}: {close: ()=>void}) {
-
+
+ { sending && (
+
+ )}
+ { !sending && (
+
+ )}
+