Skip to content

Commit

Permalink
Merge pull request #14 from andrew-fenton/navbar
Browse files Browse the repository at this point in the history
fix recording bug
  • Loading branch information
gordnzhou authored Sep 15, 2024
2 parents 2559146 + 5d7019a commit eb13289
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
8 changes: 6 additions & 2 deletions frontend/src/routes/recorder.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ function Recorder({transcript, setTranscript}) {
useEffect(() => {
if (done) {
// Navigates to summary page with finished transcript state
navigateTo('/summary')
}

if (transcript.length > 0) {
navigateTo('/summary');
setDone(false);
}
}
}, [done]);

const scrollToBottom = () => {
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/routes/summary.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ function Summary({transcript}) {
console.log(response.data);
setSummary(response.data);
setIsLoading(false);
};
} else {
navigateTo('/record');
}
} catch (err) {
console.error(err);
}
Expand Down
10 changes: 8 additions & 2 deletions frontend/src/widgets/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@ function Navbar() {
padding: "15px",
}}>
<div></div>
<h2><Link style={{ textDecoration: "none", color: "black", fontWeight: 600 }} to="/">memora.</Link></h2>
<FaBook size={30} style={{ color: "black" }}/>
<h2>
<Link style={{ textDecoration: "none", color: "black", fontWeight: 600 }} to="/">
memora.
</Link>
</h2>
<Link to="/journal">
<FaBook size={30} style={{ color: "black" }}/>
</Link>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,[email protected],100..700,0..1,-50..200" />
</nav>
);
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/widgets/VoiceButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,13 @@ export default function VoiceButton({setTranscript, setDone}) {
} else {
recognition.stop();
setIsVoiceActive(false);
setDone(true);

if (transcribedText.length > 0) {
setTranscribedText(transcribedText)
}
}

setDone(isVoiceActive);
};

return (
Expand Down

0 comments on commit eb13289

Please sign in to comment.