Open tonypuglieso opened 4 days ago
In fact, there is already a function in code that can do something similar but it has not been used.
I will add this feature in the next version.
Great, for now I'm change this for use local. But its better have a setting in options. Thanks for answer!.
// src/io.ts
var mutex = new Mutex();
async function insertMessage(vault, message, tFile) {
const release2 = await mutex.acquire();
try {
const fileContent = await vault.read(tFile);
if (fileContent.trim() === "") {
vault.modify(tFile, message);
} else {
const updatedContent = ${message}\n${fileContent}
;
vault.modify(tFile, updatedContent);
}
} catch (error) {
throw new Error(Error inserting message. ${error}
);
} finally {
release2();
}
}
Hello, I wrote this tread to find out if there is a possibility to have the text inserted at the top of the note.
That would be how chats work, the last message is the one you see first.