@open-tender/utils 0.4.13 → 0.4.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -86,8 +86,10 @@ const makeRecents = (recents, itemLookup, soldOut) => {
|
|
|
86
86
|
};
|
|
87
87
|
exports.makeRecents = makeRecents;
|
|
88
88
|
const makeRecentItems = (categories, soldOut, orders) => {
|
|
89
|
-
|
|
89
|
+
if (!orders.length)
|
|
90
|
+
return [];
|
|
90
91
|
const displayItems = (0, cart_1.makeUniqueDisplayItems)(orders);
|
|
92
|
+
const itemLookup = (0, exports.makeMenuItemLookup)(categories);
|
|
91
93
|
return (0, exports.makeRecents)(displayItems, itemLookup, soldOut);
|
|
92
94
|
};
|
|
93
95
|
exports.makeRecentItems = makeRecentItems;
|
|
@@ -109,6 +111,8 @@ const makeFavorites = (favorites, itemLookup, soldOut) => {
|
|
|
109
111
|
};
|
|
110
112
|
exports.makeFavorites = makeFavorites;
|
|
111
113
|
const makeFavoriteItems = (categories, soldOut, favorites) => {
|
|
114
|
+
if (!favorites.length)
|
|
115
|
+
return [];
|
|
112
116
|
const itemLookup = (0, exports.makeMenuItemLookup)(categories);
|
|
113
117
|
return (0, exports.makeFavorites)(favorites, itemLookup, soldOut);
|
|
114
118
|
};
|
|
@@ -79,8 +79,10 @@ export const makeRecents = (recents, itemLookup, soldOut) => {
|
|
|
79
79
|
}, []);
|
|
80
80
|
};
|
|
81
81
|
export const makeRecentItems = (categories, soldOut, orders) => {
|
|
82
|
-
|
|
82
|
+
if (!orders.length)
|
|
83
|
+
return [];
|
|
83
84
|
const displayItems = makeUniqueDisplayItems(orders);
|
|
85
|
+
const itemLookup = makeMenuItemLookup(categories);
|
|
84
86
|
return makeRecents(displayItems, itemLookup, soldOut);
|
|
85
87
|
};
|
|
86
88
|
export const makeFavorites = (favorites, itemLookup, soldOut) => {
|
|
@@ -100,6 +102,8 @@ export const makeFavorites = (favorites, itemLookup, soldOut) => {
|
|
|
100
102
|
}, []);
|
|
101
103
|
};
|
|
102
104
|
export const makeFavoriteItems = (categories, soldOut, favorites) => {
|
|
105
|
+
if (!favorites.length)
|
|
106
|
+
return [];
|
|
103
107
|
const itemLookup = makeMenuItemLookup(categories);
|
|
104
108
|
return makeFavorites(favorites, itemLookup, soldOut);
|
|
105
109
|
};
|
package/package.json
CHANGED