26
loading...
This website collects cookies to deliver better user experience
tryGettingResizedDownloadUrl()
) [Vuex Store Action]tryGettingResizedDownloadUrl()
function will try to create a DownloadUrl. If it fails, it will wait 800ms and then retries again by calling itself recursively. As soon as it finds a downloadUrl for that image, this Url is returned. It finds a download url by repeatedly checking if the file exists on the storage filesystem which matches the defined filename pattern (filename_${width}x${height}.{fileExtension}
). After x-retries it stops and returns null
.tryGettingResizedDownloadUrl()
-function does not deliver a result and returns null
, the full-size image is stored in the database as a fallback.storage.js
Vuex-Module.await sleep(800)
) and the recursively calls itself again (return dispatch('tryGettingResizedDownloadUrl', { url, size, retry })
). It is crucial to add the return
before the dispatch()
, otherwise the action won't return anything.resizedUrl
variable awaits the the results from the action and is either a string
containing the URL or null
. In case of the latter, fullImageUrl
is saved.