Skip to content

Commit

Permalink
Condensing dealId check (prebid#4105).
Browse files Browse the repository at this point in the history
  • Loading branch information
mcallari committed Aug 29, 2019
1 parent b4889be commit 0253678
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions modules/optimeraBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,8 @@ export const spec = {
for (let i = 0; i < validBids.length; i += 1) {
if (typeof validBids[i].params.clientID !== 'undefined') {
if (validBids[i].adUnitCode in scores) {
const deviceCode = deepAccess(validBids[i], 'params.device');
dealId = scores[validBids[i].adUnitCode];
if (deepAccess(scores, `device.${deviceCode}.${validBids[i].adUnitCode}`)) {
dealId = scores.device[deviceCode][validBids[i].adUnitCode];
}
const deviceDealId = deepAccess(scores, `device.${validBids[i].params.device}.${validBids[i].adUnitCode}`);
dealId = deviceDealId || scores[validBids[i].adUnitCode];
}
const bidResponse = {
requestId: validBids[i].bidId,
Expand Down

0 comments on commit 0253678

Please sign in to comment.