Skip to content

Commit b033a98

Browse files
committed
fix: limit calls to assemble api on sound swallower retries
1 parent b2dab2b commit b033a98

1 file changed

Lines changed: 15 additions & 10 deletions

File tree

packages/studio-web/src/app/upload/upload.component.ts

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import {
1313
map,
1414
takeUntil,
1515
throwError,
16+
firstValueFrom,
17+
take,
1618
} from "rxjs";
1719

1820
import {
@@ -437,16 +439,19 @@ Please check it to make sure all words are spelled out completely, e.g. write "4
437439
this.studioService.audioControl$.value as File,
438440
8000,
439441
),
440-
ras: this.fileService
441-
.readFile$(this.studioService.textControl$.value)
442-
.pipe(
443-
switchMap((text: string): Observable<ReadAlong> => {
444-
body.input = text;
445-
this.progressMode = "determinate";
446-
this.progressValue = 0;
447-
return this.rasService.assembleReadalong$(body);
448-
}),
449-
),
442+
ras: firstValueFrom(
443+
this.fileService
444+
.readFile$(this.studioService.textControl$.value)
445+
.pipe(
446+
switchMap((text: string): Observable<ReadAlong> => {
447+
body.input = text;
448+
this.progressMode = "determinate";
449+
this.progressValue = 0;
450+
return this.rasService.assembleReadalong$(body);
451+
}),
452+
take(1),
453+
),
454+
),
450455
})
451456
.pipe(
452457
switchMap(

0 commit comments

Comments
 (0)