Fix undo and redo by using initial commit hash for chat (#94)

This commit is contained in:
Will Chen
2025-05-06 12:15:42 -07:00
committed by GitHub
parent 390496f8f8
commit 20362d7b08
10 changed files with 434 additions and 101 deletions

View File

@@ -189,12 +189,20 @@ export function registerAppHandlers() {
});
// Create initial commit
await git.commit({
const commitHash = await git.commit({
fs: fs,
dir: fullAppPath,
message: "Init from react vite template",
author: await getGitAuthor(),
});
// Update chat with initial commit hash
await db
.update(chats)
.set({
initialCommitHash: commitHash,
})
.where(eq(chats.id, chat.id));
} catch (error) {
logger.error("Error in background app initialization:", error);
}