Skip to content

Commit 3be4bed

Browse files
committed
Add giftideas bookmarks. Switch to using FileManager.renameFile interface.
1 parent 093599c commit 3be4bed

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ import {
1212
interface BrainframeSettings {
1313
gitmarks: string;
1414
products: string;
15+
giftideas: string;
1516
archived: string;
1617
}
1718

1819
const DEFAULT_SETTINGS: BrainframeSettings = {
1920
gitmarks: 'gitmarks.md',
2021
products: 'products.md',
22+
giftideas: 'giftideas.md',
2123
archived: '_archived'
2224
}
2325

@@ -79,7 +81,7 @@ export default class Brainframe extends Plugin {
7981
async archiveNote(toArchive: TAbstractFile|null) {
8082
await this.ensureArchiveExists();
8183
if (toArchive instanceof TFile) {
82-
await this.app.vault.rename(toArchive, `${this.settings.archived}/${toArchive?.name}`)
84+
await this.app.fileManager.renameFile(toArchive, `${this.settings.archived}/${toArchive?.name}`)
8385
await this.app.fileManager.processFrontMatter(toArchive, (frontMatter) => {
8486
if (frontMatter.tags == null) {
8587
frontMatter.tags = new Array<string>;
@@ -98,6 +100,7 @@ export default class Brainframe extends Plugin {
98100

99101
await this.addMarksFile(this.settings.gitmarks, 'add-gitmark', 'Add Git bookmark');
100102
await this.addMarksFile(this.settings.products, 'add-productmark', 'Add Product bookmark');
103+
await this.addMarksFile(this.settings.giftideas, 'add-giftidea', 'Add Gift Idea bookmark');
101104

102105
this.addCommand({
103106
id: 'archive-note',

0 commit comments

Comments
 (0)