Better handling when there are no cards for AnkiView
This commit is contained in:
@@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user