update ItemCount if EmailItem allows multiples
All checks were successful
Build / build (18) (push) Successful in 56s
Build / build (20) (push) Successful in 57s
Build / build (22) (push) Successful in 39s
Build / build (22) (pull_request) Successful in 37s
Build / build (20) (pull_request) Successful in 56s
Build / build (18) (pull_request) Successful in 1m0s
All checks were successful
Build / build (18) (push) Successful in 56s
Build / build (20) (push) Successful in 57s
Build / build (22) (push) Successful in 39s
Build / build (22) (pull_request) Successful in 37s
Build / build (20) (pull_request) Successful in 56s
Build / build (18) (pull_request) Successful in 1m0s
This commit is contained in:
parent
26ad8fceff
commit
514e306394
@ -946,11 +946,16 @@ export const addEmailItem = async (
|
||||
typeName: string,
|
||||
inventoryChanges: IInventoryChanges = {}
|
||||
): Promise<IInventoryChanges> => {
|
||||
const emailItem = ExportEmailItems[typeName];
|
||||
if (!emailItem.sendOnlyOnce || !inventory.EmailItems.find(x => x.ItemType == typeName)) {
|
||||
await createMessage(inventory.accountOwnerId.toString(), [convertInboxMessage(emailItem.message)]);
|
||||
const meta = ExportEmailItems[typeName];
|
||||
const emailItem = inventory.EmailItems.find(x => x.ItemType == typeName);
|
||||
if (!emailItem || !meta.sendOnlyOnce) {
|
||||
await createMessage(inventory.accountOwnerId.toString(), [convertInboxMessage(meta.message)]);
|
||||
|
||||
if (emailItem) {
|
||||
emailItem.ItemCount += 1;
|
||||
} else {
|
||||
inventory.EmailItems.push({ ItemType: typeName, ItemCount: 1 });
|
||||
}
|
||||
|
||||
inventoryChanges.EmailItems ??= [];
|
||||
inventoryChanges.EmailItems.push({ ItemType: typeName, ItemCount: 1 });
|
||||
|
Loading…
x
Reference in New Issue
Block a user