fix: handle file save bug (#36)

This commit is contained in:
Ishaan Dey 2024-06-27 23:43:18 -07:00 committed by GitHub
parent 9f0b6a8fdc
commit 2fbabbd403
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -192,6 +192,8 @@ io.on("connection", async (socket) => {
// todo: send diffs + debounce for efficiency
socket.on("saveFile", async (fileId: string, body: string) => {
if (!fileId) return; // handles saving when no file is open
try {
if (Buffer.byteLength(body, "utf-8") > MAX_BODY_SIZE) {
socket.emit(