From fbf8698ce30359fc3858bec5e56e60000a8a9a94 Mon Sep 17 00:00:00 2001 From: Lost Paul <70213368+LostPaul@users.noreply.github.com> Date: Thu, 23 Mar 2023 08:49:39 +0100 Subject: [PATCH] Update deleteConfirmation.ts --- src/modals/deleteConfirmation.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/modals/deleteConfirmation.ts b/src/modals/deleteConfirmation.ts index 62cbc3c..704c9bc 100644 --- a/src/modals/deleteConfirmation.ts +++ b/src/modals/deleteConfirmation.ts @@ -21,7 +21,16 @@ export default class DeleteConfirmationModal extends Modal { // Create a container for the buttons and the checkbox const buttonContainer = setting.infoEl.createEl('div', { cls: 'fn-delete-confirmation-modal-buttons' }); - if (Platform.isDesktopApp) { + if (Platform.isMobileApp) { + const confirmButton = buttonContainer.createEl('button', { text: 'Delete and don\'t ask again' }); + confirmButton.classList.add('mod-warning', 'fn-confirmation-modal-button'); + confirmButton.addEventListener('click', async () => { + this.plugin.settings.showDeleteConfirmation = false; + this.plugin.saveSettings(); + this.close(); + this.app.vault.delete(this.file); + }); + } else { const checkbox = buttonContainer.createEl('input', { type: 'checkbox' }); checkbox.addEventListener('change', (e) => { const target = e.target as HTMLInputElement; @@ -36,15 +45,6 @@ export default class DeleteConfirmationModal extends Modal { checkBoxText.addEventListener('click', () => { checkbox.click(); }); - } else if (Platform.isMobileApp) { - const confirmButton = buttonContainer.createEl('button', { text: 'Delete and don\'t ask again' }); - confirmButton.classList.add('mod-warning', 'fn-confirmation-modal-button'); - confirmButton.addEventListener('click', async () => { - this.plugin.settings.showDeleteConfirmation = false; - this.plugin.saveSettings(); - this.close(); - this.app.vault.delete(this.file); - }); } const button = buttonContainer.createEl('button', { text: 'Delete' }); button.classList.add('mod-warning', 'fn-confirmation-modal-button');