mirror of
https://github.com/lostpaul/obsidian-folder-notes.git
synced 2026-07-22 07:40:24 +00:00
Update deleteConfirmation.ts
This commit is contained in:
parent
e3e18e83c0
commit
fbf8698ce3
1 changed files with 10 additions and 10 deletions
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Reference in a new issue