chore: removed logs, added comments
This commit is contained in:
parent
f683ff6480
commit
1d92b6ea6f
@ -143,8 +143,6 @@ io.on("connection", async (socket) => {
|
||||
isOwner: boolean;
|
||||
};
|
||||
|
||||
console.log("user:",data)
|
||||
|
||||
if (data.isOwner) {
|
||||
isOwnerConnected = true;
|
||||
connections[data.sandboxId] = (connections[data.sandboxId] ?? 0) + 1;
|
||||
@ -185,7 +183,6 @@ io.on("connection", async (socket) => {
|
||||
fixPermissions();
|
||||
|
||||
socket.emit("loaded", sandboxFiles.files);
|
||||
console.log("files got", sandboxFiles.files)
|
||||
|
||||
socket.on("getFile", (fileId: string, callback) => {
|
||||
console.log(fileId);
|
||||
|
@ -49,10 +49,8 @@ export default function Dashboard({
|
||||
const q = searchParams.get("q")
|
||||
const router = useRouter()
|
||||
|
||||
useEffect(() => {
|
||||
// if (!sandboxes) {
|
||||
router.refresh() // fix: update the dashboard to show the new project
|
||||
// }
|
||||
useEffect(() => { // update the dashboard to show a new project
|
||||
router.refresh()
|
||||
}, [sandboxes])
|
||||
|
||||
return (
|
||||
|
@ -45,13 +45,11 @@ export default function CodeEditor({
|
||||
const { socket, setUserAndSandboxId } = useSocket();
|
||||
|
||||
useEffect(() => {
|
||||
console.log('Effect triggered:', { socket, userData, sandboxData });
|
||||
// Ensure userData.id and sandboxData.id are available before attempting to connect
|
||||
if (userData.id && sandboxData.id) {
|
||||
// Check if the socket is not initialized or not connected
|
||||
if (!socket || (socket && !socket.connected)) {
|
||||
// Initialize socket connection
|
||||
console.log('Initializing socket...');
|
||||
setUserAndSandboxId(userData.id, sandboxData.id);
|
||||
}
|
||||
}
|
||||
@ -445,7 +443,6 @@ export default function CodeEditor({
|
||||
|
||||
const onLoadedEvent = (files: (TFolder | TFile)[]) => {
|
||||
setFiles(files)
|
||||
console.log("loaded", files)
|
||||
}
|
||||
|
||||
const onError = (message: string) => {
|
||||
@ -484,7 +481,6 @@ export default function CodeEditor({
|
||||
socket?.off("disableAccess", onDisableAccess)
|
||||
socket?.off("previewURL", loadPreviewURL)
|
||||
}
|
||||
// }, []);
|
||||
}, [socket, terminals, setTerminals, setFiles, toast, setDisableAccess, isOwner, loadPreviewURL]);
|
||||
|
||||
// Helper functions for tabs:
|
||||
|
Loading…
x
Reference in New Issue
Block a user