Skip to content

Commit

Permalink
Merge branch 'main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronshiel committed Oct 5, 2023
2 parents db85082 + 0033a60 commit 86461a5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
4 changes: 3 additions & 1 deletion client/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1847,7 +1847,8 @@ export async function uploadVideo(
accessToken: string,
uploadLambdaEndpoint: string,
trim?: { start: number; end: number },
hasEditedTranscript?: boolean
hasEditedTranscript?: boolean,
generateThumbnail?: boolean
): Promise<UploadProcessAsyncJob> {
const presignedUrl: PresignedUrlResponse = await execHttp(
"GET",
Expand Down Expand Up @@ -1903,6 +1904,7 @@ export async function uploadVideo(
isVbgVideo: isVbgVideo,
trim: trim,
hasEditedTranscript: hasEditedTranscript,
generateThumbnail: generateThumbnail,
}),
headers: {
"Content-Type": "multipart/form-data",
Expand Down
11 changes: 10 additions & 1 deletion client/src/hooks/graphql/use-with-record-state.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export function useWithRecordState(

const mentorId = getData((state) => state.data?._id);
const mentorType = getData((state) => state.data?.mentorType);
const mentorThumbnail = getData((state) => state.data?.thumbnail);
const hasVirtualBackground = getData(
(state) => state.data?.hasVirtualBackground
);
Expand Down Expand Up @@ -537,9 +538,15 @@ export function useWithRecordState(

async function uploadVideo(trim?: { start: number; end: number }) {
const answer = answers[answerIdx];

if (!mentorId || !answer.answer.question) {
return;
}
const question = getValueIfKeyExists(
answer.answer.question,
mentorQuestions
);

const editedAnswer: Answer = {
...answer.editedAnswer,
previousVersions: await getUpdatedAnswerVersions(
Expand Down Expand Up @@ -596,7 +603,9 @@ export function useWithRecordState(
answer.answer.question,
answer.recordedVideo,
Boolean(hasVirtualBackground),
trim
trim,
undefined,
!mentorThumbnail && question?.question?.name === UtteranceName.IDLE
);
}
}
Expand Down
9 changes: 6 additions & 3 deletions client/src/hooks/graphql/use-with-upload-status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ export function useWithUploadStatus(
video: File,
isVbgVideo: boolean,
trim?: { start: number; end: number },
hasEditedTranscript?: boolean
hasEditedTranscript?: boolean,
generateThumbnail?: boolean
) {
dispatch(
newFileUploadStarted({
Expand Down Expand Up @@ -254,7 +255,8 @@ export function useWithUploadStatus(
accessToken,
configState.config?.uploadLambdaEndpoint || "",
trim,
hasEditedTranscript
hasEditedTranscript,
generateThumbnail
)
.then((task) => {
addOrEditTask({
Expand Down Expand Up @@ -301,7 +303,8 @@ export interface UseWithUploadStatus {
video: File,
isVbgVideo: boolean,
trim?: { start: number; end: number },
hasEditedTranscript?: boolean
hasEditedTranscript?: boolean,
generateThumbnail?: boolean
) => void;
removeCompletedOrFailedTask: (tasks: UploadTask) => void;
initialLoadComplete: boolean;
Expand Down

0 comments on commit 86461a5

Please sign in to comment.