Added empty food menu notice, code for checking the app version, possible fix for jumpy CollectionView behaviour, TODO: check on real device

This commit is contained in:
Deniz Duezgoeren
2019-10-19 09:29:59 +02:00
parent fc8349d30c
commit ede4f0cc0a
7 changed files with 29 additions and 6 deletions
+8 -2
View File
@@ -169,6 +169,7 @@ class DataFetcher {
var isPlanEmpty = true
var isPersonalEmpty = true
var isFoodMenuEmpty = true
var personalPlanCount = 0
var mWebsitePriority = 0
@@ -267,6 +268,7 @@ class DataFetcher {
indices.append(foodItems.size())
for l in 0..<indices.count - 1 {
isFoodMenuEmpty = false
var s = ""
for i2 in indices[l]..<indices[l + 1] {
if (s.isEmpty) {
@@ -290,8 +292,12 @@ class DataFetcher {
prefs.set(infoString.trimmingCharacters(in: .whitespacesAndNewlines), forKey: "information")
for food in foodmenuList {
try db.run(foodmenu.insert(text <- food))
if isFoodMenuEmpty {
try db.run(foodmenu.insert(text <- NSLocalizedString("food_menu_empty", comment: "")))
} else {
for food in foodmenuList {
try db.run(foodmenu.insert(text <- food))
}
}
} catch {