-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I created a way to sync files between github and bolt.new however upon refresh it deletes the files i loaded #382
Comments
This is very cool Important Notes:
|
I am still trying to solve this, forked the project, the updated changes and the clean script can be found below: Reproduction Steps: (Tested on Win10)
Use the script inside the repo:
And the rest is still exactly like in the video, hope we can figure it out that will be awesome |
I just figured out something... and I believe its the key to solve it!
async function openDatabase() {
return new Promise((resolve) => {
const request = indexedDB.open('boltHistory', 1);
request.onupgradeneeded = (event) => {
const db = (event.target).result;
if (!db.objectStoreNames.contains('chats')) {
const store = db.createObjectStore('chats', { keyPath: 'id' });
store.createIndex('id', 'id', { unique: true });
store.createIndex('urlId', 'urlId', { unique: true });
}
};
request.onsuccess = (event) => {
resolve((event.target).result);
};
request.onerror = (event) => {
resolve(undefined);
};
});
}
const db = await openDatabase(); This defined Then: const transaction = db.transaction('chats', 'readwrite');
const store = transaction.objectStore('chats');
const chats = store.getAll();
console.log(chats); This will output the chats Then I copied the chat I want to edit and pasted it in here: const transaction = db.transaction('chats', 'readwrite');
const store = transaction.objectStore('chats');
const add_request = store.put(HERE); e.g... const transaction = db.transaction('chats', 'readwrite');
const store = transaction.objectStore('chats');
const add_request = store.put({
"id": "5",
"messages": [*Redacted*],
"urlId": "5",
"description": "Create Text File (fork)",
"timestamp": "2024-11-22T..."
}); In my example I modified this message from {
"id": "Redacted",
"role": "assistant",
"content": "<boltArtifact id=\"create-hello6-file\" title=\"Create hello6 File with Color Name\">\n <boltAction type=\"file\" filePath=\"hello6.txt\">\n green\n </boltAction>\n</boltArtifact>\n\nI have created a new file named \"hello6.txt\" with the content \"green\".",
"createdAt": "2024-11-22T..."
} I refreshed, the file content changed from This will allow me to create a fix for our problem @TristanWillcox ! |
Done! https://github.com/burgil/bolt.new-any-llm_windows
Feel free to close this issue. 2024-11-23_06-04-58.mp4Update:
Fixed. |
This is super cool. Will you push this into the main oTToDev repo too? Also do you have to use Mistral for cloning? Thanks for the work. :) |
Hi everyone, I have a question. I accidentally deleted this code without knowing what it was for, and now I'm getting the following error: vbnet jsx return (
|
Hi @nigelp, If the owner of the repo wants he may merge my changes, or you can use it directly from my repo
Hi @adriano2023666, I'm sorry but I don't know how to help you, your issue is not related to ours, try to submit a new issue detailing as much as possible what happened, where it happened, how to replicate it, and etc. |
2024-11-22.15-29-02.mp4
in the video, you see I uploaded files from a previous bolt project I made on the official bolt website. Below is the code I use to transfer files from a GitHub repo into the bolt.new local version but as you can see in the video it deletes the files upon refresh and also doesn't not know the context of the code that is imported
help would be appreciated thanks
boltsyncfix.js
The text was updated successfully, but these errors were encountered: