Issue :
In PyIDE.jsx, if a user accidentally refreshes the page or navigates away, unsaved local changes to the code might be lost before they are synced to the shared project.
Recommendation : Save the current editor content to localStorage as a temporary backup.
File Path : pytogether/frontend/reactapp/src/pages/PyIDE.jsx
Suggested Logic :
// Inside the component
useEffect(() => {
const backup = localStorage.getItem(`editor_backup_${projectId}`);
if (backup && !code) {
setCode(backup);
}
}, [projectId]);
const handleCodeChange = (newCode) => {
setCode(newCode);
localStorage.setItem(`editor_backup_${projectId}`, newCode);
};
Issue :
In
PyIDE.jsx, if a user accidentally refreshes the page or navigates away, unsaved local changes to the code might be lost before they are synced to the shared project.Recommendation : Save the current editor content to
localStorageas a temporary backup.File Path :
pytogether/frontend/reactapp/src/pages/PyIDE.jsxSuggested Logic :