add catch
This commit is contained in:
parent
bf7fe2bf75
commit
321a888921
1 changed files with 18 additions and 13 deletions
|
|
@ -65,21 +65,26 @@ export function registerSamplesFromDB(config = userSamplesDBConfig, onComplete =
|
||||||
sounds.set(parentDirectory, soundPaths);
|
sounds.set(parentDirectory, soundPaths);
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
).then(() => {
|
)
|
||||||
sounds.forEach((soundPaths, key) => {
|
.then(() => {
|
||||||
const value = Array.from(soundPaths);
|
sounds.forEach((soundPaths, key) => {
|
||||||
registerSound(key, (t, hapValue, onended) => onTriggerSample(t, hapValue, onended, value), {
|
const value = Array.from(soundPaths);
|
||||||
type: 'sample',
|
registerSound(key, (t, hapValue, onended) => onTriggerSample(t, hapValue, onended, value), {
|
||||||
samples: value,
|
type: 'sample',
|
||||||
baseUrl: undefined,
|
samples: value,
|
||||||
prebake: false,
|
baseUrl: undefined,
|
||||||
tag: undefined,
|
prebake: false,
|
||||||
|
tag: undefined,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
logger('imported sounds registered!', 'success');
|
logger('imported sounds registered!', 'success');
|
||||||
onComplete();
|
onComplete();
|
||||||
});
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
logger('Something went wrong while registering saved samples from the index db', 'error');
|
||||||
|
console.error(error);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue