mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-06 22:58:19 -05:00
moved Undefined to be first category
This commit is contained in:
@@ -785,6 +785,9 @@ export default {
|
|||||||
|
|
||||||
var groups = { false: {}, true: {} } // force unchecked to always be first
|
var groups = { false: {}, true: {} } // force unchecked to always be first
|
||||||
if (this.selected_supermarket) {
|
if (this.selected_supermarket) {
|
||||||
|
// TODO: make nulls_first a user setting
|
||||||
|
groups.false[this.$t("Undefined")] = {}
|
||||||
|
groups.true[this.$t("Undefined")] = {}
|
||||||
let super_cats = this.supermarkets
|
let super_cats = this.supermarkets
|
||||||
.filter((x) => x.id === this.selected_supermarket)
|
.filter((x) => x.id === this.selected_supermarket)
|
||||||
.map((x) => x.category_to_supermarket)
|
.map((x) => x.category_to_supermarket)
|
||||||
@@ -795,9 +798,6 @@ export default {
|
|||||||
groups["true"][cat] = {}
|
groups["true"][cat] = {}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
// TODO: make nulls_first a user setting
|
|
||||||
groups.false[this.$t("Undefined")] = {}
|
|
||||||
groups.true[this.$t("Undefined")] = {}
|
|
||||||
this.shopping_categories.forEach((cat) => {
|
this.shopping_categories.forEach((cat) => {
|
||||||
groups.false[cat.name] = {}
|
groups.false[cat.name] = {}
|
||||||
groups.true[cat.name] = {}
|
groups.true[cat.name] = {}
|
||||||
@@ -1132,6 +1132,15 @@ export default {
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
this.auto_sync_running = false
|
this.auto_sync_running = false
|
||||||
|
let new_entries = data.map((x) => x.id).filter((y) => !this.items.map((z) => z.id).includes(y))
|
||||||
|
if (new_entries.length > 0) {
|
||||||
|
let api = new ApiApiFactory()
|
||||||
|
new_entries.forEach((new_id) => {
|
||||||
|
api.retrieveShoppingListEntry(new_id).then((result) => {
|
||||||
|
this.items.push(result.data)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
moveEntry: function (e, item) {
|
moveEntry: function (e, item) {
|
||||||
if (!e) {
|
if (!e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user