Correção do bug de frontend quando o usuario busca pela url um ticked id que não existe

pull/20/head
adriano 2023-06-20 09:17:30 -03:00
parent 40f5840edf
commit f0f49668ff
1 changed files with 13 additions and 2 deletions

View File

@ -31,11 +31,22 @@ const useStyles = makeStyles(theme => ({
const TicketActionButtons = ({ ticket, statusChatEnd }) => {
const classes = useStyles();
const history = useHistory();
const history = useHistory();
const [anchorEl, setAnchorEl] = useState(null);
const [loading, setLoading] = useState(false);
const [useDialogflow, setUseDialogflow] = useState(ticket.contact.useDialogflow);
// const [useDialogflow, setUseDialogflow] = useState(ticket.contact.useDialogflow);
const [useDialogflow, setUseDialogflow] = useState(() => {
if (Object.keys(ticket).length != 0) {
return ticket.contact.useDialogflow;
} else {
// Set a default value if `ticket.contact.useDialogflow` is null
return true
}
});
const ticketOptionsMenuOpen = Boolean(anchorEl);
const { user } = useContext(AuthContext);