handle undefined

This commit is contained in:
an-lee
2024-03-28 16:46:49 +08:00
parent bdc3865b9d
commit 2bea14fbdf

View File

@@ -96,6 +96,8 @@ export const MediaCurrentRecording = (props: { height?: number }) => {
* with the original pitch contour.
*/
const renderComparingPitchContour = () => {
if (!currentRecording) return;
const region = mediaRegions
.getRegions()
.find((r) => r.id.startsWith("segment-region"));
@@ -171,6 +173,8 @@ export const MediaCurrentRecording = (props: { height?: number }) => {
};
const handleShare = async () => {
if (!currentRecording) return;
if (!currentRecording.uploadedAt) {
try {
await EnjoyApp.recordings.upload(currentRecording.id);