Package:
“sendbird-desk”: “^1.0.22”
I followed the documentation given here: Create your first ticket | Desk JavaScript SDK | Sendbird Docs
I have a text input element to get the first message to be sent on ticket creation and the value is stored in ticketTextInput as string.
And this is my function that is called when a button is clicked, by passing this function to its onClick method:
const createSBTicket = () => {
const message: UserMessageCreateParams = {
message: ticketTextInput
};
Ticket.getAllTickets(0, (tickets, error) => {
if (error) {
console.log(error);
}
console.log(tickets);
const ticketsLength = tickets.length;
console.log("ticketsLength", ticketsLength);
// offset += tickets.length; for the next tickets.
// Implement your code to display the ticket list.
Ticket.create("Conversation #" + ticketsLength.toString(), "", (ticket, error) => {
if (error) {
// Handle error.
console.log(error);
}
// The ticket.channel property indicates the group channel object within the ticket.
// @ts-ignore
ticket.channel.sendUserMessage(message);
});
});
};
When I click on the button after entering a text in the input box, I get this error on Chrome.
See the follow-up message on this thread for the error I get on Safari for the same action.
What could be the issue here? Thanks in advance.