Correção do bug de frontend quando o usuario busca pela url um ticked id que não existe
parent
40f5840edf
commit
f0f49668ff
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue