Skip to content

Commit

Permalink
Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
Waschnick committed Mar 4, 2019
1 parent 046f4b6 commit 79e794e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions src/scripts/core/core_vendor_information.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const DEFAULT_CUSTOM_VENDOR_LIST = {
export let cachedVendorList;
export let cachedCustomVendorList;
export let pendingVendorlistPromise = null;
export let pendingCustomVendorlistPromise = null;

export function loadVendorListAndCustomVendorList() {
if (cachedVendorList && cachedCustomVendorList) {
Expand All @@ -41,14 +40,15 @@ export function loadVendorListAndCustomVendorList() {
.then(response => {
sortVendors(response);
cachedVendorList = response;
pendingVendorlistPromise = null;
})
.catch(error => {
pendingVendorlistPromise = null;
logError(`OIL getVendorList failed and returned error: ${error}. Falling back to default vendor list!`);
})
.finally(() => {
loadCustomVendorList().finally(() => resolve());
loadCustomVendorList().finally(() => {
pendingVendorlistPromise = null;
resolve()
});
});
});
}
Expand All @@ -64,13 +64,12 @@ function loadCustomVendorList() {
fetchJsonData(customVendorListUrl)
.then(response => {
cachedCustomVendorList = response;
pendingCustomVendorlistPromise = null;
})
.catch(error => {
cachedCustomVendorList = DEFAULT_CUSTOM_VENDOR_LIST;
pendingCustomVendorlistPromise = null;
logError(`OIL getCustomVendorList failed and returned error: ${error}. Falling back to default vendorlist!`);
}).finally(() => resolve());
})
.finally(() => resolve());
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion test/specs/core/core_vendor_information.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import VENDOR_LIST from '../../fixtures/vendorlist/simple_vendor_list.json';
import CUSTOM_VENDOR_LIST from '../../fixtures/vendorlist/custom_vendor_list.json';
import { resetOil } from '../../test-utils/utils_reset';

fdescribe('core_vendor_information', () => {
describe('core_vendor_information', () => {

const WHITELISTED_VENDORS = [1, 2];
const BLACKLISTED_VENDORS = Array.apply(null, {length: (DEFAULT_VENDOR_LIST.maxVendorId - 2)}).map(Number.call, Number).slice(1);
Expand Down

0 comments on commit 79e794e

Please sign in to comment.