fixed againd the blink

This commit is contained in:
2026-02-06 11:03:01 -06:00
parent b47478c605
commit 5670b7688d
2 changed files with 9 additions and 10 deletions
@@ -5,10 +5,9 @@ import { envConfig } from "@/app/lib/config";
import toast from "react-hot-toast";
import { getEquipoByCount } from "@/app/lib/getEquipoByCount";
import { getMesaByCount } from "@/app/lib/getMesaByCount";
import "./asignacion.css";
import { getMesaByCount } from "@/app/lib/getMesaByCount";
import { error } from "console";
type Props = {
inscripcion: any[];
@@ -22,7 +21,7 @@ export default function PlaticaGate({ inscripcion, numAcount }: Props) {
const [equipoSeleccionado, setEquipoSeleccionado] = useState<any>(null);
const [open, setOpen] = useState(false);
const [tiempo, setTiempo] = useState<number>(15);
const [bitacora, setBitacora] = useState<[] | null>(null);
const [bitacora, setBitacora] = useState<[] | null>([]);
const fetchByCuenta = async (idCuenta: number) => {
const [result, resultMesa] = await Promise.all([
@@ -30,12 +29,12 @@ export default function PlaticaGate({ inscripcion, numAcount }: Props) {
getMesaByCount(idCuenta),
]);
if (result?.error | resultMesa?.error) {
if (result?.error && resultMesa?.error) {
setBitacora(null);
} else {
setBitacora([]);
if (result?.error) toast.error("Ya cuentas con un equipo asignado");
if (resultMesa?.error) toast.error("Ya cuentas con una mesa asignada");
if (!result?.error) toast.error("Ya cuentas con un equipo asignado");
if (!resultMesa?.error) toast.error("Ya cuentas con una mesa asignada");
}
};
+4 -4
View File
@@ -17,7 +17,7 @@ export default function AsignacionMesas({ idCuenta, inscripcion }: Props) {
const [loadingMesas, setLoadingMesas] = useState(false);
const [mesaSeleccionada, setMesaSeleccionada] = useState<any>(null);
const [tiempo, setTiempo] = useState<number>(15);
const [bitacora, setBitacora] = useState<[] | null>(null);
const [bitacora, setBitacora] = useState<[] | null>([]);
const fetchByCuenta = async (idCuenta: number) => {
const [result, resultMesa] = await Promise.all([
@@ -25,12 +25,12 @@ export default function AsignacionMesas({ idCuenta, inscripcion }: Props) {
getMesaByCount(idCuenta),
]);
if (result?.error | resultMesa?.error) {
if (result?.error && resultMesa?.error) {
setBitacora(null);
} else {
setBitacora([]);
if (result?.error) toast.error("Ya cuentas con un equipo asignado");
if (resultMesa?.error) toast.error("Ya cuentas con una mesa asignada");
if (!result?.error) toast.error("Ya cuentas con un equipo asignado");
if (!resultMesa?.error) toast.error("Ya cuentas con una mesa asignada");
}
};