Correção do bug de frontend quando o usuario busca pela url um ticked id que não existe
parent
40f5840edf
commit
f0f49668ff
|
@ -35,7 +35,18 @@ const TicketActionButtons = ({ ticket, statusChatEnd }) => {
|
||||||
|
|
||||||
const [anchorEl, setAnchorEl] = useState(null);
|
const [anchorEl, setAnchorEl] = useState(null);
|
||||||
const [loading, setLoading] = useState(false);
|
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 ticketOptionsMenuOpen = Boolean(anchorEl);
|
||||||
const { user } = useContext(AuthContext);
|
const { user } = useContext(AuthContext);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue