diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 22d2267..b5ddc3a 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -26,6 +26,6 @@ version-resolver: - 'patch' default: patch template: | - ## Changes + # Changes $CHANGES diff --git a/README.md b/README.md index e69de29..7c5346f 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,25 @@ +## Defining .env file + +--- + +### React client environment variables + +- REACT_APP_API_ROOT: Domain root for react app api +- REACT_APP_DOMAIN_ROOT: Domain root for react app +- BUILD_PATH: Path for client build folder + +### Courier client + +- COURIER_AUTH_TOKEN: Authorization token for courier client + +### Node environment variables + +- NODE_ENV: Node environment +- PORT: Default node port + +### Production database information + +- DB_USERNAME: Production database username +- DB_PASSWORD: Production database password +- DB_HOST: Production database host ip +- DB_NAME: Production database name diff --git a/client/src/components/utils/RecordMp3.jsx b/client/src/components/utils/RecordMp3.jsx index b9dd767..a111099 100644 --- a/client/src/components/utils/RecordMp3.jsx +++ b/client/src/components/utils/RecordMp3.jsx @@ -25,7 +25,7 @@ function RecordMp3() { .get( `${ process.env.REACT_APP_DOMAIN_ROOT - }/public/audio/${Cookies.get('token')}.mp3`, + }/public/audio/${Cookies.get('userID')}.mp3`, { responseType: 'blob', } @@ -41,7 +41,6 @@ function RecordMp3() { }, []); function togglePlay() { - console.log(uploadedFile); if (audio && !audio.ended) { audio.pause(); audio.currentTime = 0; @@ -53,14 +52,13 @@ function RecordMp3() { } } - async function record() { + function record() { if (recording) { - console.log('Stopped Recording'); + setRecording(() => false); recorder .stop() .getMp3() .then(([buffer, blob]) => { - setRecording(() => false); setUploadedFile(() => { return new File(buffer, 'userAudio.mp3', { type: blob.type, @@ -69,14 +67,10 @@ function RecordMp3() { }); }); } else { - recorder - .start() - .then(() => { - setRecording(() => true); - }) - .catch((e) => { - console.error(e); - }); + setRecording(() => true); + recorder.start().catch((e) => { + console.error(e); + }); } }