Skip to content

Commit

Permalink
fix dupNumberAlways not working (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
reorx committed Jan 30, 2023
1 parent 37cb800 commit 6a40d76
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) => {
Expand Down

0 comments on commit 6a40d76

Please sign in to comment.