Laravel Vapor - Attempt to solve random downloading of 0KB pdf files when using docker

This commit is contained in:
Dillon Ngo
2024-01-04 03:38:32 +08:00
parent 8a99ceda4c
commit 359eba36e3
@@ -10,7 +10,7 @@
<div class="col text-center">
<img :src="src" class="w-100" v-if="type !== 'pdf'">
<div class="btn btn-complete pointer m-b-20" @click="openBase64NewTab()" v-show="type === 'pdf'">Open in new window</div>
<iframe v-if="type === 'pdf'" class="pdf-display w-100 scrollable" style="height: 80vh" :src="'data:application/pdf;base64,'+src"></iframe>
<iframe v-if="type === 'pdf' && isClicked" class="pdf-display w-100 scrollable" style="height: 80vh" :src="'data:application/pdf;base64,'+src"></iframe>
</div>
</div>
</modal-component>
@@ -30,7 +30,8 @@
return {
isLoading: false,
loaded: false,
src: ''
src: '',
isClicked: false
}
},
computed: {
@@ -40,6 +41,7 @@
},
methods:{
loadFile(){
this.isClicked = true;
if(!this.loaded) {
this.isLoading = true;
let filePath = this.type === 'pdf' ? this.file.file.file_info.original.file : this.file.file.file_info[0].original.file;