Skip to content

Commit 9828ec0

Browse files
committed
feat: trigger the unsplash download endpoint as required by the unsplash guidelines
1 parent 5a47bbc commit 9828ec0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/LiveDevelopment/BrowserScripts/RemoteFunctions.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3013,6 +3013,17 @@ function RemoteFunctions(config = {}) {
30133013
const extnName = ".jpg";
30143014

30153015
const downloadUrl = image.url || image.thumb_url;
3016+
3017+
// we need to make a req to the download endpoint
3018+
// its required by the Unsplash API guidelines to track downloads for photographers
3019+
// this is just a tracking call, we don't need to wait for the response
3020+
if (image.download_location) {
3021+
fetch(image.download_location)
3022+
.catch(error => {
3023+
//
3024+
});
3025+
}
3026+
30163027
this._useImage(downloadUrl, filename, extnName, false, thumbDiv);
30173028
});
30183029

0 commit comments

Comments
 (0)