From 6a40d76b6837f4a29bcaf9fcbe77501645499dc3 Mon Sep 17 00:00:00 2001 From: Reorx Date: Mon, 30 Jan 2023 17:03:29 +0800 Subject: [PATCH] fix dupNumberAlways not working (#34) --- src/main.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index a8674bf..3b15cf0 100644 --- a/src/main.ts +++ b/src/main.ts @@ -334,7 +334,7 @@ export default class PasteImageRenamePlugin extends Plugin { dupNameNumbers.push(parseInt(m.groups.number)) } - if (isNewNameExist) { + if (isNewNameExist || this.settings.dupNumberAlways) { // get max number const newNumber = dupNameNumbers.length > 0 ? Math.max(...dupNameNumbers) + 1 : 1 // change newName @@ -616,7 +616,7 @@ class SettingTab extends PluginSettingTab { new Setting(containerEl) .setName('Always add duplicate number') - .setDesc(`If enabled, duplicate number will always be added to the image name, otherwise it will only be added when the name is duplicated.`) + .setDesc(`If enabled, duplicate number will always be added to the image name. Otherwise, it will only be added when the name is duplicated.`) .addToggle(toggle => toggle .setValue(this.plugin.settings.dupNumberAlways) .onChange(async (value) => {