Skip to content

Commit

Permalink
Temporarily remove changing file modification time when creating file
Browse files Browse the repository at this point in the history
  • Loading branch information
Alt-er committed Nov 28, 2023
1 parent d586c81 commit b15ec89
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion manifest.json
@@ -1,7 +1,7 @@
{
"id": "notes-sync-share",
"name": "Notes Sync Share",
"version": "1.2.2",
"version": "1.2.3",
"minAppVersion": "0.15.0",
"description": "Sync and share (publish) your notes in your own private service.",
"author": "Alt-er",
Expand Down
17 changes: 9 additions & 8 deletions src/main.ts
Expand Up @@ -604,14 +604,15 @@ export default class NoteSyncSharePlugin extends Plugin {
})

// 这里一定要延迟执行, 因为create会在obsidian启动时每个文件都触发一次
setTimeout(() => {
this.app.vault.on("create", async (file) => {
if (file instanceof TFile) {
const arrayBuffer = await this.app.vault.adapter.readBinary(file.path)
this.app.vault.modifyBinary(file, arrayBuffer, { ctime: Date.now() })
}
})
}, 3500)
// 暂时去掉这个功能
// setTimeout(() => {
// this.app.vault.on("create", async (file) => {
// if (file instanceof TFile) {
// const arrayBuffer = await this.app.vault.adapter.readBinary(file.path)
// this.app.vault.modifyBinary(file, arrayBuffer, { ctime: Date.now() })
// }
// })
// }, 3500)


// This creates an icon in the left ribbon.
Expand Down
3 changes: 2 additions & 1 deletion versions.json
Expand Up @@ -9,5 +9,6 @@
"1.1.6": "0.15.0",
"1.2.0": "0.15.0",
"1.2.1": "0.15.0",
"1.2.2": "0.15.0"
"1.2.2": "0.15.0",
"1.2.3": "0.15.0"
}

0 comments on commit b15ec89

Please sign in to comment.