Skip to content

Commit

Permalink
push
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoltan Erdos committed Sep 30, 2024
1 parent fc33151 commit 292370d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packages/code/src/@/lib/make-sess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ export const makeSession = (p: ICodeSession): ICodeSession =>
transpiled: "",
})({
i: p.i || 0,

codeSpace: p.codeSpace || "",
code: p.code || "export default ()=> <>Nothing</>",
html: p.html || "",
css: (p.css || ""),
Expand Down
1 change: 1 addition & 0 deletions packages/code/src/@/workers/socket.worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ async function handleBroadcastMessage(
if (connection.lastCounter < bMod!.i) {
console.log("Updating session");
const { code, html, css, i, transpiled } = bMod!;

const json = stringifySession({ code, html, css, codeSpace, i, transpiled });
try {
await fetch(`/live/${codeSpace}/session`, {
Expand Down
4 changes: 2 additions & 2 deletions packages/code/src/ChatInterface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const ChatInterface: React.FC<{
}
}, 1000);



return ;
}
Expand Down Expand Up @@ -86,7 +86,7 @@ export const ChatInterface: React.FC<{
setEditInput,
cSess,
});

useEffect(() => {
console.log("ChatInterface rendered");
console.log("messages", messages);
Expand Down
4 changes: 4 additions & 0 deletions packages/code/src/services/CodeSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ export class Code implements ICode {
return this.session;
}

public hash = () => {
makeSession({ ...this.session });
};

async setCode(
rawCode: string,
skipRunning = false,
Expand Down

0 comments on commit 292370d

Please sign in to comment.