fix(manual print): fixed so the print disables
This commit is contained in:
@@ -18,6 +18,7 @@ export default function ManualPrint({ lot }: { lot: LotType }) {
|
|||||||
//const serverUrl = `http://${server}:${serverPort}`;
|
//const serverUrl = `http://${server}:${serverPort}`;
|
||||||
|
|
||||||
const handlePrintLabel = async (lot: LotType) => {
|
const handlePrintLabel = async (lot: LotType) => {
|
||||||
|
setPrinting(true);
|
||||||
const labels: any = await manualPrintLabels(lot, session?.user);
|
const labels: any = await manualPrintLabels(lot, session?.user);
|
||||||
|
|
||||||
if (labels.success) {
|
if (labels.success) {
|
||||||
@@ -25,7 +26,6 @@ export default function ManualPrint({ lot }: { lot: LotType }) {
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
setPrinting(false);
|
setPrinting(false);
|
||||||
}, 5 * 1000);
|
}, 5 * 1000);
|
||||||
setPrinting(true);
|
|
||||||
} else {
|
} else {
|
||||||
toast.error(labels.message);
|
toast.error(labels.message);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user