chore: remove duplicate conditional
This commit is contained in:
		
							parent
							
								
									abeb17ce44
								
							
						
					
					
						commit
						0b18932dd8
					
				@ -77,21 +77,23 @@ export const addMissionInventoryUpdates = async (
 | 
				
			|||||||
    inventoryUpdates: IMissionInventoryUpdateRequest
 | 
					    inventoryUpdates: IMissionInventoryUpdateRequest
 | 
				
			||||||
): Promise<IInventoryChanges> => {
 | 
					): Promise<IInventoryChanges> => {
 | 
				
			||||||
    const inventoryChanges: IInventoryChanges = {};
 | 
					    const inventoryChanges: IInventoryChanges = {};
 | 
				
			||||||
    if (inventoryUpdates.RewardInfo && inventoryUpdates.RewardInfo.periodicMissionTag) {
 | 
					    if (inventoryUpdates.RewardInfo) {
 | 
				
			||||||
        const tag = inventoryUpdates.RewardInfo.periodicMissionTag;
 | 
					        if (inventoryUpdates.RewardInfo.periodicMissionTag) {
 | 
				
			||||||
        const existingCompletion = inventory.PeriodicMissionCompletions.find(completion => completion.tag === tag);
 | 
					            const tag = inventoryUpdates.RewardInfo.periodicMissionTag;
 | 
				
			||||||
 | 
					            const existingCompletion = inventory.PeriodicMissionCompletions.find(completion => completion.tag === tag);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (existingCompletion) {
 | 
					            if (existingCompletion) {
 | 
				
			||||||
            existingCompletion.date = new Date();
 | 
					                existingCompletion.date = new Date();
 | 
				
			||||||
        } else {
 | 
					            } else {
 | 
				
			||||||
            inventory.PeriodicMissionCompletions.push({
 | 
					                inventory.PeriodicMissionCompletions.push({
 | 
				
			||||||
                tag: tag,
 | 
					                    tag: tag,
 | 
				
			||||||
                date: new Date()
 | 
					                    date: new Date()
 | 
				
			||||||
            });
 | 
					                });
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        if (inventoryUpdates.RewardInfo.NemesisAbandonedRewards) {
 | 
				
			||||||
 | 
					            inventory.NemesisAbandonedRewards = inventoryUpdates.RewardInfo.NemesisAbandonedRewards;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    if (inventoryUpdates.RewardInfo && inventoryUpdates.RewardInfo.NemesisAbandonedRewards) {
 | 
					 | 
				
			||||||
        inventory.NemesisAbandonedRewards = inventoryUpdates.RewardInfo.NemesisAbandonedRewards;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (
 | 
					    if (
 | 
				
			||||||
        inventoryUpdates.MissionFailed &&
 | 
					        inventoryUpdates.MissionFailed &&
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user