Better handling when there are no cards for AnkiView

This commit is contained in:
2024-04-07 17:00:54 +02:00
parent 9c567c96f6
commit 1512053e34

View File

@@ -14,8 +14,8 @@ struct AnkiView: View {
model.getFlashCardsToDisplay() model.getFlashCardsToDisplay()
} }
var body: some View { var body: some View {
GeometryReader { geometry in if flashcard != nil {
if flashcard != nil { GeometryReader { geometry in
VStack { VStack {
FlashCardView(flashcard: flashcard!, showDescription: $showDescription) FlashCardView(flashcard: flashcard!, showDescription: $showDescription)
if showDescription { if showDescription {
@@ -57,9 +57,12 @@ struct AnkiView: View {
.padding([.bottom, .trailing, .leading]) .padding([.bottom, .trailing, .leading])
} }
} }
} else {
Text("There is no word to display, come back later")
} }
} else {
Text("There are currently no words to display")
.padding()
.background(.yellow)
.clipShape(.buttonBorder)
} }
} }
} }