提交H5业务闭环修复代码
This commit is contained in:
@@ -52,14 +52,14 @@ export class ExplainUseCase {
|
||||
) {}
|
||||
|
||||
private applyTrackAudioState(exhibit: MuseumExhibit, track?: ExplainTrack | null): MuseumExhibit {
|
||||
const hasExhibitAudio = exhibit.audioAvailable === true || Boolean(exhibit.audioUrl)
|
||||
const hasTrackAudio = track?.available === true
|
||||
const hasPlayableAudioUrl = Boolean(exhibit.audioUrl?.trim())
|
||||
const hasTrackTarget = Boolean(track?.playTargetType || track?.playTargetId)
|
||||
|
||||
if (!hasExhibitAudio && !hasTrackAudio) return exhibit
|
||||
if (!hasPlayableAudioUrl && !hasTrackTarget) return exhibit
|
||||
|
||||
return {
|
||||
...exhibit,
|
||||
audioAvailable: true,
|
||||
audioAvailable: hasPlayableAudioUrl,
|
||||
playTargetType: track?.playTargetType || exhibit.playTargetType,
|
||||
playTargetId: track?.playTargetId || exhibit.playTargetId
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user