regenerate something when the sentences changed
This commit is contained in:
@@ -27,7 +27,8 @@ struct PlayerSectionView: View {
|
||||
SentenceExplanationSheet(
|
||||
mediaId: controller.currentItem?.id ?? "",
|
||||
courseTitle: controller.currentItem?.title ?? "口语训练课程",
|
||||
sentence: sentence
|
||||
sentence: sentence,
|
||||
sentences: controller.currentItem?.sentences ?? []
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -273,6 +274,7 @@ struct SentenceExplanationSheet: View {
|
||||
let mediaId: String
|
||||
let courseTitle: String
|
||||
let sentence: SentenceBoundary
|
||||
var sentences: [SentenceBoundary] = []
|
||||
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
@State private var explanation = ""
|
||||
@@ -327,6 +329,7 @@ struct SentenceExplanationSheet: View {
|
||||
}
|
||||
}
|
||||
.task {
|
||||
SentenceExplanationStore.shared.sync(mediaId: mediaId, sentences: sentences)
|
||||
if let cached = SentenceExplanationStore.shared.load(
|
||||
mediaId: mediaId,
|
||||
sentenceIndex: sentence.index
|
||||
|
||||
Reference in New Issue
Block a user