Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Commit

Permalink
[C-3049] Fix upload type error where upload type is undefined (#4046)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle-Shanks authored Sep 8, 2023
1 parent d548f80 commit 02d89fe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/web/src/pages/upload-page/UploadPageNew.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export const UploadPageNew = (props: UploadPageProps) => {
)
break
case Phase.EDIT:
if (formState.uploadType) {
if (formState.uploadType !== undefined) {
page = (
<EditPage
formState={formState}
Expand All @@ -137,7 +137,7 @@ export const UploadPageNew = (props: UploadPageProps) => {
}
break
case Phase.FINISH:
if (formState.uploadType) {
if (formState.uploadType !== undefined) {
page = (
<FinishPageNew
formState={formState}
Expand Down
5 changes: 5 additions & 0 deletions packages/web/src/pages/upload-page/forms/EditTrackForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
import cn from 'classnames'
import { Form, Formik, FormikProps, useField } from 'formik'
import moment from 'moment'
import { useUnmount } from 'react-use'
import { z } from 'zod'
import { toFormikValidationSchema } from 'zod-formik-adapter'

Expand Down Expand Up @@ -119,6 +120,10 @@ const TrackEditForm = (props: FormikProps<TrackEditFormValues>) => {
const { playingPreviewIndex, togglePreview } =
useContext(UploadPreviewContext)
const isPreviewPlaying = playingPreviewIndex === trackIdx
const [, , { setValue: setIndex }] = useField('trackMetadatasIndex')
useUnmount(() => {
setIndex(0)
})

return (
<Form>
Expand Down

0 comments on commit 02d89fe

Please sign in to comment.