Skip to content

Commit a42afff

Browse files
committed
fix: handle allowDelete
1 parent 1589efe commit a42afff

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

src/file-manager.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,10 @@ export class FileManager {
164164
if (shouldDelete) {
165165
const properties = extractProperties(this.app, file);
166166
const allowDelete = properties.allowDelete
167-
? properties.allowDelete
168-
.toLowerCase()
169-
.replace('"', "") === "true"
170-
: repo.allowDeleteIssue;
167+
? String(properties.allowDelete)
168+
.toLowerCase()
169+
.replace('"', "") === "true"
170+
: repo.allowDeleteIssue;
171171

172172
if (allowDelete) {
173173
await this.app.fileManager.trashFile(file);
@@ -223,10 +223,10 @@ export class FileManager {
223223
if (shouldDelete) {
224224
const properties = extractProperties(this.app, file);
225225
const allowDelete = properties.allowDelete
226-
? properties.allowDelete
227-
.toLowerCase()
228-
.replace('"', "") === "true"
229-
: repo.allowDeletePullRequest;
226+
? String(properties.allowDelete)
227+
.toLowerCase()
228+
.replace('"', "") === "true"
229+
: repo.allowDeletePullRequest;
230230

231231
if (allowDelete) {
232232
await this.app.fileManager.trashFile(file);
@@ -530,10 +530,10 @@ ${this.formatComments(comments, this.settings.escapeMode)}
530530
// Use Obsidian's MetadataCache to get frontmatter
531531
const properties = extractProperties(this.app, file);
532532
const allowDelete = properties.allowDelete
533-
? properties.allowDelete
534-
.toLowerCase()
535-
.replace('"', "") === "true"
536-
: false;
533+
? String(properties.allowDelete)
534+
.toLowerCase()
535+
.replace('"', "") === "true"
536+
: false;
537537

538538
if (allowDelete) {
539539
await this.app.fileManager.trashFile(file);
@@ -590,10 +590,10 @@ ${this.formatComments(comments, this.settings.escapeMode)}
590590
// Use Obsidian's MetadataCache to get frontmatter
591591
const properties = extractProperties(this.app, file);
592592
const allowDelete = properties.allowDelete
593-
? properties.allowDelete
594-
.toLowerCase()
595-
.replace('"', "") === "true"
596-
: false;
593+
? String(properties.allowDelete)
594+
.toLowerCase()
595+
.replace('"', "") === "true"
596+
: false;
597597

598598
if (allowDelete) {
599599
await this.app.fileManager.trashFile(file);

0 commit comments

Comments
 (0)