From 1512053e3463cf6af149913e7824d92d6347cdb2 Mon Sep 17 00:00:00 2001 From: oliverhnat Date: Sun, 7 Apr 2024 17:00:54 +0200 Subject: [PATCH] Better handling when there are no cards for AnkiView --- WordAX/Views/AnkiView.swift | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/WordAX/Views/AnkiView.swift b/WordAX/Views/AnkiView.swift index 8f20d1d..e1e0eb4 100644 --- a/WordAX/Views/AnkiView.swift +++ b/WordAX/Views/AnkiView.swift @@ -14,8 +14,8 @@ struct AnkiView: View { model.getFlashCardsToDisplay() } var body: some View { - GeometryReader { geometry in - if flashcard != nil { + if flashcard != nil { + GeometryReader { geometry in VStack { FlashCardView(flashcard: flashcard!, showDescription: $showDescription) if showDescription { @@ -57,9 +57,12 @@ struct AnkiView: View { .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) } } }