Skip to content

Commit

Permalink
fix some stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
cmayeux05 committed Nov 6, 2024
1 parent 701c0ee commit 497b6ce
Show file tree
Hide file tree
Showing 63 changed files with 33 additions and 20 deletions.
1 change: 1 addition & 0 deletions client/src/ScreenRecorder.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useState, useEffect } from "react";
import { ReactMediaRecorder, useReactMediaRecorder } from "react-media-recorder";
import { addVideo } from "./Utils/requests";
import { getMe } from "./Utils/requests";

const ScreenRecorder = ({ onRecordingComplete }) => {
const {
Expand Down
26 changes: 15 additions & 11 deletions client/src/ScreenRecorderWithChunks.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useEffect, useState } from 'react';
import { addVideo } from './Utils/requests';
import { server } from './Utils/hosts';
import { getMe } from './Utils/requests';

const ScreenRecorderWithChunks = () => {
const [mediaRecorder, setMediaRecorder] = useState(null);
Expand Down Expand Up @@ -67,7 +68,9 @@ const ScreenRecorderWithChunks = () => {
//console.log(blob)

//console.log(formattedDate);
formData.append('files', blob, `${localStorage.studentName} at ${formattedDate}.mp4`);
const thisStudent = await getMe();
console.log(thisStudent)
formData.append('files', blob, `${thisStudent.data['students'][0]['name']} at ${formattedDate}.mp4`);
//console.log(formData)

try {
Expand All @@ -78,7 +81,8 @@ const ScreenRecorderWithChunks = () => {

const result = await response.json();
//console.log("Upload successful:", result);
addVideo(parseInt(localStorage.studentID), result[0]);

addVideo(parseInt(thisStudent.data['students'][0]['id']), result[0]);
} catch (error) {
console.error("Error uploading the recording:", error);
}
Expand Down Expand Up @@ -123,18 +127,18 @@ const ScreenRecorderWithChunks = () => {

return () => clearInterval(intervalId); // Cleanup on component unmount
}, [isRecording]);
useEffect(() => {
setTimeout(() => {
setTimerD(parseInt(timerd) + 1)
//useEffect(() => {
//setTimeout(() => {
//setTimerD(parseInt(timerd) + 1)

//console.log('howdy')
//console.log(isRecording)
if (localStorage.isRecording == 'false' && timerd != 0) {
console.log('false')
window.location.reload()
}
}, 10000)
}, [timerd])
// if (localStorage.isRecording == 'false' && timerd != 0) {
// console.log('false')
// window.location.reload()
// }
// }, 10000)
//}, [timerd])
return (
<div></div>
);
Expand Down
9 changes: 8 additions & 1 deletion client/src/Utils/requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -787,4 +787,11 @@ export const getSchoolList = async() =>
video: video
}
});



export const getMe = async() =>
makeRequest({
method: GET,
path: `${server}/students/me`,
auth: true,
});
2 changes: 1 addition & 1 deletion server/config/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = ({ env }) => ({
username: env('DATABASE_USERNAME', 'postgres'),
password: env('DATABASE_PASSWORD', 'postgres'),
schema: 'public',
ssl: {rejectUnauthorized: false}
ssl: {rejectUnauthorized: false},
},
options: {
'pool': {
Expand Down
13 changes: 7 additions & 6 deletions server/config/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,18 @@ module.exports = {
options: {
br: false
}
}
},
// logger: {
// // dev + prod
// level: debug + info,
// requests: true + false
// }

// dev
// cors: {
// enabled: true,
// origin: ['http://localhost:3000', 'http://localhost:1337']
// },
dev : {
cors: {
enabled: true,
origin: ['http://localhost:3000', 'http://localhost:1337']
}
},
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"name": "Apache 2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
},
"x-generation-date": "10/23/2024 10:40:54 PM"
"x-generation-date": "11/05/2024 8:24:49 PM"
},
"x-strapi-config": {
"path": "/documentation",
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 497b6ce

Please sign in to comment.