mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 17:33:14 +01:00
Fix bugs in ErrorQueueStore and deepMatchObject()
This commit is contained in:
parent
4821e36189
commit
0d6b3710f7
@ -10,7 +10,7 @@ class ErrorQueueStore {
|
|||||||
constructor() {
|
constructor() {
|
||||||
const { upload: { slowConnection, tryDifferentBrowser } } = ErrorClasses;
|
const { upload: { slowConnection, tryDifferentBrowser } } = ErrorClasses;
|
||||||
|
|
||||||
this.errorQueue = {
|
this.errorQueues = {
|
||||||
'upload': {
|
'upload': {
|
||||||
queue: [slowConnection, tryDifferentBrowser],
|
queue: [slowConnection, tryDifferentBrowser],
|
||||||
loop: true
|
loop: true
|
||||||
@ -19,11 +19,14 @@ class ErrorQueueStore {
|
|||||||
|
|
||||||
// Add intial index to each error queue
|
// Add intial index to each error queue
|
||||||
Object
|
Object
|
||||||
.keys(this.errorQueue)
|
.keys(this.errorQueues)
|
||||||
.forEach((type) => {
|
.forEach((type) => {
|
||||||
this.errorQueue[type].index = 0;
|
this.errorQueues[type].index = 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Bind the exported functions to this instance
|
||||||
|
this.getNextError = this.getNextError.bind(this);
|
||||||
|
|
||||||
this.exportPublicMethods({
|
this.exportPublicMethods({
|
||||||
getNextError: this.getNextError
|
getNextError: this.getNextError
|
||||||
});
|
});
|
||||||
|
@ -213,9 +213,12 @@ export function deepMatchObject(obj, match, testFn) {
|
|||||||
const objProp = obj[matchKey];
|
const objProp = obj[matchKey];
|
||||||
const matchProp = match[matchKey];
|
const matchProp = match[matchKey];
|
||||||
|
|
||||||
return (typeof matchProp === 'object') ? testObjAgainstMatch(objProp, matchProp, testFn)
|
if (typeof matchProp === 'object') {
|
||||||
: testFn(objProp, matchProp);
|
return (typeof objProp === 'object') ? deepMatchObject(objProp, matchProp, testFn)
|
||||||
|
: false;
|
||||||
|
} else {
|
||||||
|
return testFn(objProp, matchProp);
|
||||||
|
}
|
||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user