From 304d56e23f934c8eb550ca30369d0c5ec0a43e44 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Fri, 7 Aug 2026 01:24:46 +0530 Subject: [PATCH] fix: resolve 4 bugs in Debugra --- server/routes/rooms.js | 2 +- src/hooks/useEditor.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/routes/rooms.js b/server/routes/rooms.js index a3ede0a7..57bfb307 100644 --- a/server/routes/rooms.js +++ b/server/routes/rooms.js @@ -46,7 +46,7 @@ router.post('/verify-password', roomPasswordLimiter, async (req, res) => { const { roomId, password } = req.body; // ── Basic validation ───────────────────────────────────────────────────── - if (!roomId || typeof roomId !== 'string' || roomId.trim() === '') { + if (!roomId || typeof roomId !== 'string' || roomId.trim().length === 0) { return res.status(400).json({ error: 'roomId is required.' }); } if (!password || typeof password !== 'string' || password.trim() === '') { diff --git a/src/hooks/useEditor.js b/src/hooks/useEditor.js index e9000dfd..868ddce6 100644 --- a/src/hooks/useEditor.js +++ b/src/hooks/useEditor.js @@ -147,7 +147,7 @@ export function useEditor({ user, onNeedAuth }) { }, [code, language, stdinValue]); useEffect(() => { - if (!autosaveInterval) return undefined; + if (!autosaveInterval) return; const timer = window.setInterval(() => { localStorage.setItem(