I am working on this project and I got stuck here: When I click on the button the image that was uploaded earlier should show. It shows, but only if I click on the button 2-3 times. It looks like it takes some time before i can use the storage ref.
`$(document).on("click",".edit", function(){
var id = $(this).data('edit');
firebase.storage().ref('Images/'+id).getDownloadURL().then(function(url){
imgurl=url;
});
$(".myimg").attr("src", imgurl);
`