From 0210ae189aa10531cf1d3f9c84fde862b9aff2e0 Mon Sep 17 00:00:00 2001 From: Eis Date: Mon, 18 Jul 2022 19:41:04 +0300 Subject: [PATCH] Fix filtering images by location --- src/machines/machine-create.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/machines/machine-create.js b/src/machines/machine-create.js index c6b6fb32..46b7e802 100644 --- a/src/machines/machine-create.js +++ b/src/machines/machine-create.js @@ -2146,11 +2146,10 @@ Polymer({ }, _getLocationImages(location) { - if (location && this.model && this.model.clouds) - return this.model.imagesArray.filter( + if (location && this.model && this.model.clouds && this.selectedCloud && this.model.clouds[this.selectedCloud]) + return this.model.clouds[this.selectedCloud].imagesArray.filter( im => - im.locations && - (!im.locations || im.locations.indexOf(location) > -1) + !im.locations || im.locations.indexOf(location) > -1 ); return []; },