Prevent selection of null file

This commit is contained in:
2019-05-26 21:18:04 +05:30
parent aa46296f53
commit 9039f220d3

View File

@@ -88,9 +88,14 @@ $(document).ready(()=>{
},
error: err=>console.log(err)
})*/
$('.file-download-button').after(`<a id="down-temp" href="/files/cat?loc=${currSel.loc}" download="${currSel.name}"></a>`)
document.getElementById('down-temp').click()
$('#down-temp').remove();
if(currSel.loc===null){
alert("Please select a file");
}
else{
$('.file-download-button').after(`<a id="down-temp" href="/files/cat?loc=${currSel.loc}" download="${currSel.name}"></a>`)
document.getElementById('down-temp').click()
$('#down-temp').remove();
}
})
$('.close-rename').click(()=>{
$('.rename-window').fadeOut('fast')