Skip to content
This repository was archived by the owner on Jul 2, 2023. It is now read-only.

Commit 3d7d88e

Browse files
Merge pull request #90 from AndresMorelos/v1.20.0
V1.20.0
2 parents cf7c983 + 2a9b0ca commit 3d7d88e

21 files changed

+86
-21
lines changed

app.js

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,21 @@ function createMainWindow() {
154154
mainWindow.on('close', (event) => {
155155
event.preventDefault();
156156
if (isDev || forceDevtools) mainWindow.webContents.closeDevTools();
157-
app.isHidden = true;
158-
if (process.platform !== 'darwin') {
159-
mainWindow.setSkipTaskbar(true);
157+
158+
const needCloseApp =
159+
appConfig.getSync('general.quitAtClose') || false;
160+
161+
if (!needCloseApp) {
162+
app.isHidden = true;
163+
if (process.platform !== 'darwin') {
164+
mainWindow.setSkipTaskbar(true);
165+
} else {
166+
app.dock.hide();
167+
}
168+
mainWindow.hide();
160169
} else {
161-
app.dock.hide();
170+
app.quit();
162171
}
163-
mainWindow.hide();
164172
});
165173
}
166174

@@ -298,6 +306,7 @@ function setInitialValues() {
298306
lastCheck: Date.now(),
299307
enableMetrics: true,
300308
openAtLogin: true,
309+
quitAtClose: false,
301310
},
302311
invoice: {
303312
exportDir: os.homedir(),
@@ -481,8 +490,8 @@ function migrateData() {
481490
},
482491
6: (configs) => {
483492
// Return current configs if this is the first time install
484-
const { trayIcon, enableMetrics } = configs.general;
485-
if (trayIcon !== undefined && enableMetrics !== undefined) {
493+
const { openAtLogin } = configs.general;
494+
if (openAtLogin !== undefined) {
486495
return configs;
487496
}
488497

@@ -495,6 +504,22 @@ function migrateData() {
495504
},
496505
};
497506
},
507+
7: (configs) => {
508+
// Return current configs if this is the first time install
509+
const { quitAtClose } = configs.general;
510+
if (quitAtClose !== undefined) {
511+
return configs;
512+
}
513+
514+
// Update current configs
515+
return {
516+
...configs,
517+
general: {
518+
...configs.general,
519+
quitAtClose: false,
520+
},
521+
};
522+
},
498523
};
499524
// Get the current Config
500525
const configs = appConfig.getSync();

app/components/settings/General.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class General extends Component {
3838
trayIcon,
3939
enableMetrics,
4040
openAtLogin,
41+
quitAtClose,
4142
} = this.state;
4243
return (
4344
<div>
@@ -213,13 +214,13 @@ class General extends Component {
213214
<div className="col-md-3">
214215
<div className="pageItem">
215216
<label className="itemLabel">
216-
{t('settings:fields:sendMetricsAnon')}
217+
{t('settings:fields:quitAtClose')}
217218
</label>
218219
<label className="switch">
219220
<input
220-
name="enableMetrics"
221+
name="quitAtClose"
221222
type="checkbox"
222-
checked={enableMetrics}
223+
checked={quitAtClose}
223224
onChange={this.handleInputChange}
224225
/>
225226
<span className="slider round" />

i18n/en/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"trayIcon": "Menu Bar Icon",
2121
"sendMetricsAnon": "Send App Metrics Anonymously",
2222
"openAtLogin": "Open at Login",
23+
"quitAtClose": "Quit at Close",
2324
"mute": "Mute",
2425
"autoCheckUpdate": {
2526
"name": "Auto Check for Update",

i18n/esES/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"requiredFields": "Campos requeridos",
1818
"sound": "Sonido",
1919
"mute": "Silenciar",
20+
"quitAtClose": "Salir al cerrar",
2021
"autoCheckUpdate": {
2122
"name": "Buscar actualizaciones automáticamente",
2223
"daily": "Diariamente (Recomendado)",

i18n/nl/form.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"header": {
3+
"contactEdit": "Contact aanpassen",
34
"new": "Nieuwe factuur aanmaken",
45
"edit": "Factuur bewerken",
56
"btns": {
@@ -20,6 +21,12 @@
2021
"quantity": "Aantal",
2122
"add": "Nieuw item toevoegen"
2223
},
24+
"paymentItems": {
25+
"name": "Voorschot",
26+
"description": "Beschrijving",
27+
"value": "Bedrag",
28+
"add": "Voeg een voorschot toe"
29+
},
2330
"recipient": {
2431
"name": "Ontvanger",
2532
"select": "Selecteer",

i18n/nl/invoices.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
"invoiceID": "Factuurnummer",
88
"createdDate": "Gemaakt op",
99
"dueDate": "Vervaldatum",
10-
"total": "Totaal Bedrag"
10+
"total": "Totaal Bedrag",
11+
"prepaid": "Voorschot",
12+
"remaining": "Resterend bedrag"
1113
},
1214
"status": {
1315
"pending": "In behandeling",

i18n/nl/messages.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
},
99
"contact": {
1010
"saved": "Uw contactpersoon is met succes opgeslagen",
11+
"updated": "Contact succesvol aangepast",
1112
"deleted": "Uw contactpersoon is met succes verwijderd"
1213
},
1314
"settings": {

i18n/nl/settings.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
"sound": "Geluid",
2020
"trayIcon": "Menubalkitem",
2121
"sendMetricsAnon": "Stuur App Metrics Anoniem",
22+
"openAtLogin": "Open at Login",
23+
"quitAtClose": "Quit at Close",
2224
"mute": "Dempen",
2325
"autoCheckUpdate": {
2426
"name": "Check automatisch voor updates",

i18n/nl/tour.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"slides": {
88
"welcome": {
99
"heading": "👋 Hallo",
10-
"description": "Bedankt voor het proberen van Invoncify. Graag laten wij zien hoe u een verbluffend factuur maakt met slechts 4 eenvoudige stappen"
10+
"description": "Bedankt voor het proberen van Invoncify. Graag laten wij zien hoe u een verbluffende factuur maakt met slechts 4 eenvoudige stappen"
1111
},
1212
"create": {
1313
"heading": "Stap 1. Aanmaken",

i18n/ro/form.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"header": {
3+
"contactEdit": "Editare contact",
34
"new": "Creează o factură nouă",
45
"edit": "Editează factură",
56
"btns": {
@@ -20,6 +21,12 @@
2021
"quantity": "Cantitate",
2122
"add": "Adaugă un element nou"
2223
},
24+
"paymentItems": {
25+
"name": "Preplăți",
26+
"description": "Descriere",
27+
"value": "Valoare",
28+
"add": "Adaugă un element nou de preplată"
29+
},
2330
"recipient": {
2431
"name": "Destinatar",
2532
"select": "Selectează",

0 commit comments

Comments
 (0)