aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/components/settings/services/EditServiceForm.tsx23
-rw-r--r--src/i18n/locales/de.json1
-rw-r--r--src/i18n/locales/en-US.json1
3 files changed, 24 insertions, 1 deletions
diff --git a/src/components/settings/services/EditServiceForm.tsx b/src/components/settings/services/EditServiceForm.tsx
index 00629b6b6..084478982 100644
--- a/src/components/settings/services/EditServiceForm.tsx
+++ b/src/components/settings/services/EditServiceForm.tsx
@@ -1,3 +1,4 @@
1import { app, dialog } from '@electron/remote';
1import { mdiInformation } from '@mdi/js'; 2import { mdiInformation } from '@mdi/js';
2import { noop } from 'lodash'; 3import { noop } from 'lodash';
3import { observer } from 'mobx-react'; 4import { observer } from 'mobx-react';
@@ -34,6 +35,10 @@ const messages = defineMessages({
34 id: 'settings.service.form.deleteButton', 35 id: 'settings.service.form.deleteButton',
35 defaultMessage: 'Delete service', 36 defaultMessage: 'Delete service',
36 }, 37 },
38 confirmDeleteService: {
39 id: 'settings.service.form.confirmDeleteService',
40 defaultMessage: 'Do you really want to delete the {serviceName} service?',
41 },
37 openDarkmodeCss: { 42 openDarkmodeCss: {
38 id: 'settings.service.form.openDarkmodeCss', 43 id: 'settings.service.form.openDarkmodeCss',
39 defaultMessage: 'Open darkmode.css', 44 defaultMessage: 'Open darkmode.css',
@@ -248,7 +253,23 @@ class EditServiceForm extends Component<IProps, IState> {
248 buttonType="danger" 253 buttonType="danger"
249 label={intl.formatMessage(messages.deleteService)} 254 label={intl.formatMessage(messages.deleteService)}
250 className="settings__delete-button" 255 className="settings__delete-button"
251 onClick={onDelete} 256 onClick={() => {
257 // @ts-expect-error Fix me
258 const selection = dialog.showMessageBoxSync(app.mainWindow, {
259 type: 'question',
260 message: intl.formatMessage(messages.deleteService),
261 detail: intl.formatMessage(messages.confirmDeleteService, {
262 serviceName: service?.name || recipe.name,
263 }),
264 buttons: [
265 intl.formatMessage(globalMessages.yes),
266 intl.formatMessage(globalMessages.no),
267 ],
268 });
269 if (selection === 0) {
270 onDelete();
271 }
272 }}
252 /> 273 />
253 ); 274 );
254 275
diff --git a/src/i18n/locales/de.json b/src/i18n/locales/de.json
index 50ab8d4ce..c5c490834 100644
--- a/src/i18n/locales/de.json
+++ b/src/i18n/locales/de.json
@@ -356,6 +356,7 @@
356 "settings.service.error.message": "Das Dienst-Rezept konnte nicht geladen werden.", 356 "settings.service.error.message": "Das Dienst-Rezept konnte nicht geladen werden.",
357 "settings.service.form.addServiceHeadline": "{name} hinzufügen", 357 "settings.service.form.addServiceHeadline": "{name} hinzufügen",
358 "settings.service.form.availableServices": "Verfügbare Dienste", 358 "settings.service.form.availableServices": "Verfügbare Dienste",
359 "settings.service.form.confirmDeleteService": "Möchten Sie den Dienst {serviceName} wirklich löschen?",
359 "settings.service.form.customUrl": "Eigener Server", 360 "settings.service.form.customUrl": "Eigener Server",
360 "settings.service.form.customUrlValidationError": "Dein {name}-Server konnte nicht verifiziert werden.", 361 "settings.service.form.customUrlValidationError": "Dein {name}-Server konnte nicht verifiziert werden.",
361 "settings.service.form.darkReaderBrightness": "Dark Reader Helligkeit", 362 "settings.service.form.darkReaderBrightness": "Dark Reader Helligkeit",
diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json
index cb0f4369c..9ea73cf2a 100644
--- a/src/i18n/locales/en-US.json
+++ b/src/i18n/locales/en-US.json
@@ -356,6 +356,7 @@
356 "settings.service.error.message": "Could not load service recipe.", 356 "settings.service.error.message": "Could not load service recipe.",
357 "settings.service.form.addServiceHeadline": "Add {name}", 357 "settings.service.form.addServiceHeadline": "Add {name}",
358 "settings.service.form.availableServices": "Available services", 358 "settings.service.form.availableServices": "Available services",
359 "settings.service.form.confirmDeleteService": "Do you really want to delete the {serviceName} service?",
359 "settings.service.form.customUrl": "Custom server", 360 "settings.service.form.customUrl": "Custom server",
360 "settings.service.form.customUrlValidationError": "Could not validate custom {name} server.", 361 "settings.service.form.customUrlValidationError": "Could not validate custom {name} server.",
361 "settings.service.form.darkReaderBrightness": "Dark Reader Brightness", 362 "settings.service.form.darkReaderBrightness": "Dark Reader Brightness",