From 4515eddbc40e1c5f9ad264487816f2998db150c0 Mon Sep 17 00:00:00 2001 From: Caleb Date: Wed, 3 Jan 2018 14:47:33 -0700 Subject: [PATCH] Use cached images for new uploads (#925) --- src/valueObjects/AssetProxy.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/valueObjects/AssetProxy.js b/src/valueObjects/AssetProxy.js index 73e6fffa..ffaa80f6 100644 --- a/src/valueObjects/AssetProxy.js +++ b/src/valueObjects/AssetProxy.js @@ -20,7 +20,8 @@ export default function AssetProxy(value, fileObj, uploaded = false, asset) { } AssetProxy.prototype.toString = function () { - if (this.uploaded) return this.public_path; + // Use the deployed image path if we do not have a locally cached copy. + if (this.uploaded && !this.fileObj) return this.public_path; try { return window.URL.createObjectURL(this.fileObj); } catch (error) {