Skip to content

Commit

Permalink
Addint windows close from hidden window
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-uros committed Jul 23, 2024
1 parent 3f5609b commit 345cd35
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
content="default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self' data:; connect-src 'self'"
/>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<title>Čitač Lične Karte</title>
<title>Čitač Lične Karte - izmena</title>

</head>
<body>
Expand Down Expand Up @@ -49,7 +49,7 @@
</div>

<h1 style="color: white; text-align: center;">
Čitač lične karte
Čitač lične karte - izmena
</h1>
<div style="width: 100%; display: none; background-color: #ff0000; border-radius: 25px; text-align: center; height: 40%"
id="errorDiv">
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "id-card-reader",
"productName": "id-card-reader",
"version": "1.0.10",
"version": "1.0.11",
"description": "My Electron application description",
"main": ".vite/build/main.js",
"repository": {
Expand Down
6 changes: 1 addition & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1450,13 +1450,9 @@ async function printPdf() {
await printWindow.loadURL(pdfDataUrl);


await printWindow.webContents.executeJavaScript('setTimeout(()=>{ window.close() },30000)')
await printWindow.webContents.executeJavaScript('window.print();');

setTimeout(()=>{
if(printWindow){
printWindow.destroy()
}
}, 60000)

} catch (error) {
console.error('Failed to load URL:', error);
Expand Down

0 comments on commit 345cd35

Please sign in to comment.