From dff9f91d4c96a851ad0eb2ae1a23ba5354fcb611 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Sun, 19 Feb 2023 13:54:16 +0100 Subject: [PATCH] properly integrated bottom nav --- vue/src/apps/CookbookView/CookbookView.vue | 14 ++- .../ShoppingListView/ShoppingListView.vue | 85 +++++++++---------- vue/src/components/BottomNavigationBar.vue | 14 +-- vue/src/locales/en.json | 4 +- 4 files changed, 62 insertions(+), 55 deletions(-) diff --git a/vue/src/apps/CookbookView/CookbookView.vue b/vue/src/apps/CookbookView/CookbookView.vue index 5d45c4451..90bd0aef7 100644 --- a/vue/src/apps/CookbookView/CookbookView.vue +++ b/vue/src/apps/CookbookView/CookbookView.vue @@ -18,7 +18,8 @@ -
+
+
@@ -54,8 +55,17 @@ > -
+
+ + + + +
diff --git a/vue/src/apps/ShoppingListView/ShoppingListView.vue b/vue/src/apps/ShoppingListView/ShoppingListView.vue index 9d9594cfb..3ffa2e410 100644 --- a/vue/src/apps/ShoppingListView/ShoppingListView.vue +++ b/vue/src/apps/ShoppingListView/ShoppingListView.vue @@ -1,5 +1,5 @@ @@ -926,7 +921,7 @@ export default { * get the number of entries left in the sync queue for entry check events * @returns {Promise} promise resolving to the number of entries left */ - getSyncQueueLength: function (){ + getSyncQueueLength: function () { const wb = new Workbox('/service-worker.js'); wb.register(); return wb.messageSW({type: 'BGSYNC_COUNT_QUEUE'}).then((r) => { @@ -1071,26 +1066,26 @@ export default { this.loading = true } this.genericAPI(this.Models.SHOPPING_LIST, this.Actions.LIST, params).then((results) => { - if (!autosync) { - if (results.data?.length) { - this.items = results.data - } else { - console.log("no data returned") - } - this.loading = false + if (!autosync) { + if (results.data?.length) { + this.items = results.data } else { - if (!this.auto_sync_blocked) { - this.getSyncQueueLength().then((r) => { - if (r === 0){ - this.mergeShoppingList(results.data) - } else { - this.auto_sync_running = false - this.replaySyncQueue() - } - }) - } + console.log("no data returned") } - }) + this.loading = false + } else { + if (!this.auto_sync_blocked) { + this.getSyncQueueLength().then((r) => { + if (r === 0) { + this.mergeShoppingList(results.data) + } else { + this.auto_sync_running = false + this.replaySyncQueue() + } + }) + } + } + }) .catch((err) => { if (!autosync) { StandardToasts.makeStandardToast(this, StandardToasts.FAIL_FETCH, err) diff --git a/vue/src/components/BottomNavigationBar.vue b/vue/src/components/BottomNavigationBar.vue index a2a1f09a4..a4b771157 100644 --- a/vue/src/components/BottomNavigationBar.vue +++ b/vue/src/components/BottomNavigationBar.vue @@ -5,14 +5,14 @@
-
Recipes
+
{{ $t('Recipes') }}
-
Plans
+
{{ $t('Meal_Plan') }}
@@ -28,14 +28,14 @@ - {{ cl.label }} + {{ cl.label }} Create + class="fas fa-fw fa-plus"> {{ $t('Create Recipe') }} Import + class="fas fa-fw fa-file-import"> {{ $t('Import Recipe') }}
@@ -44,14 +44,14 @@
-
Shopping
+
{{ $t('Shopping_list') }}
-
Books
+
{{ $t('Books') }}
diff --git a/vue/src/locales/en.json b/vue/src/locales/en.json index 47ce0a5a7..2828e747f 100644 --- a/vue/src/locales/en.json +++ b/vue/src/locales/en.json @@ -476,5 +476,7 @@ "Use_Plural_Unit_Simple": "Use plural form for unit dynamically", "Use_Plural_Food_Always": "Use plural form for food always", "Use_Plural_Food_Simple": "Use plural form for food dynamically", - "plural_usage_info": "Use the plural form for units and food inside this space." + "plural_usage_info": "Use the plural form for units and food inside this space.", + "Create Recipe": "Create Recipe", + "Import Recipe": "Import Recipe" }