fix(type): type issue with TFile

This commit is contained in:
Quorafind 2025-08-27 09:17:28 +08:00
parent 221fc087ab
commit ff488e8890

View file

@ -596,7 +596,7 @@ export abstract class BaseTaskBasesView extends Component implements BasesView {
}
const tFile = this.app.vault.getAbstractFileByPath(file.path);
if (tFile && 'extension' in tFile) {
if (tFile instanceof TFile) {
const content = await this.app.vault.read(tFile);
const updatedContent = content.replace(/^#\s+.*/m, `# ${newContent}`);
await this.app.vault.modify(tFile, updatedContent);