fix selectAsset

This commit is contained in:
Travis Eden 2018-09-25 09:53:45 -04:00
parent f575edc9f3
commit bd1424acff

View file

@ -1,7 +1,13 @@
export const selectAsset = (show) => { export const selectAsset = show => {
const request = show.requestList[show.request.id]; const requestId = show.request.id;
const assetKey = request.key; let asset;
return show.assetList[assetKey]; const request = show.requestList[requestId] || null;
const assetList = show.assetList;
if (request && assetList) {
const assetKey = request.key; // note: just store this in the request
asset = assetList[assetKey] || null;
}
return asset;
}; };
export const selectShowState = (state) => { export const selectShowState = (state) => {