From d5e7c2807e4a6e7f149b5491a86155f387be845f Mon Sep 17 00:00:00 2001 From: simonhamp Date: Thu, 26 Dec 2024 17:33:39 +0000 Subject: [PATCH] Build plugin --- .../js/electron-plugin/dist/server/api/system.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/resources/js/electron-plugin/dist/server/api/system.js b/resources/js/electron-plugin/dist/server/api/system.js index 2d7b0fba..76490bcb 100644 --- a/resources/js/electron-plugin/dist/server/api/system.js +++ b/resources/js/electron-plugin/dist/server/api/system.js @@ -71,9 +71,19 @@ router.post('/print', (req, res) => __awaiter(void 0, void 0, void 0, function* silent: true, deviceName: printer, }, (success, errorType) => { - res.sendStatus(200); + if (success) { + console.log('Print job completed successfully.'); + res.sendStatus(200); + } + else { + console.error('Print job failed:', errorType); + res.sendStatus(500); + } + if (printWindow) { + printWindow.close(); + printWindow = null; + } }); - printWindow = null; }); yield printWindow.loadURL(`data:text/html;charset=UTF-8,${html}`); }));