Skip to content

Commit d5e7c28

Browse files
simonhampgithub-actions[bot]
authored andcommitted
Build plugin
1 parent 51f7750 commit d5e7c28

File tree

1 file changed

+12
-2
lines changed
  • resources/js/electron-plugin/dist/server/api

1 file changed

+12
-2
lines changed

resources/js/electron-plugin/dist/server/api/system.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,19 @@ router.post('/print', (req, res) => __awaiter(void 0, void 0, void 0, function*
7171
silent: true,
7272
deviceName: printer,
7373
}, (success, errorType) => {
74-
res.sendStatus(200);
74+
if (success) {
75+
console.log('Print job completed successfully.');
76+
res.sendStatus(200);
77+
}
78+
else {
79+
console.error('Print job failed:', errorType);
80+
res.sendStatus(500);
81+
}
82+
if (printWindow) {
83+
printWindow.close();
84+
printWindow = null;
85+
}
7586
});
76-
printWindow = null;
7787
});
7888
yield printWindow.loadURL(`data:text/html;charset=UTF-8,${html}`);
7989
}));

0 commit comments

Comments
 (0)