Fix ack + cleanup

This commit is contained in:
Sacha Weatherstone
2022-08-01 12:28:17 +10:00
parent ff91177df8
commit dcc41e8d82
3 changed files with 2 additions and 86 deletions
+2 -18
View File
@@ -20,33 +20,17 @@ export interface ChannelChatProps {
}
export const ChannelChat = ({ channel }: ChannelChatProps): JSX.Element => {
const { nodes, connection } = useDevice();
const { nodes, connection, ackMessage } = useDevice();
const [currentMessage, setCurrentMessage] = useState("");
const sendMessage = (): void => {
console.log("SENDING TEXT");
void connection?.sendText(
currentMessage,
undefined,
true,
channel.config.index, //maybe channel.config.index--
(id) => {
// console.log(`Chat Index, ${chatIndex}`);
// console.log(`Chat Index --, ${chatIndex--}`);
// console.log(
// `Chat Index computed, ${isChannel ? chatIndex-- : chatIndex}`,
// );
// dispatch(
// ackMessage({
// chatIndex: channel.config.index,
// messageId: id,
// }),
// );
console.log("Message Sent");
ackMessage(channel.config.index, id), console.log("Got Ack");
return Promise.resolve();
}