feat: make user made changes persistent after reload (#1387)
* feat: save user made changes persistent * fix: remove artifact from user message on the UI * fix: message Id generation fix
This commit is contained in:
@@ -75,6 +75,29 @@ export class FilesStore {
|
||||
getFileModifications() {
|
||||
return computeFileModifications(this.files.get(), this.#modifiedFiles);
|
||||
}
|
||||
getModifiedFiles() {
|
||||
let modifiedFiles: { [path: string]: File } | undefined = undefined;
|
||||
|
||||
for (const [filePath, originalContent] of this.#modifiedFiles) {
|
||||
const file = this.files.get()[filePath];
|
||||
|
||||
if (file?.type !== 'file') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (file.content === originalContent) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!modifiedFiles) {
|
||||
modifiedFiles = {};
|
||||
}
|
||||
|
||||
modifiedFiles[filePath] = file;
|
||||
}
|
||||
|
||||
return modifiedFiles;
|
||||
}
|
||||
|
||||
resetFileModifications() {
|
||||
this.#modifiedFiles.clear();
|
||||
|
||||
Reference in New Issue
Block a user