Skip to content

Commit

Permalink
fix(files): set file values on beforeMount so user can close overlay …
Browse files Browse the repository at this point in the history
…and still download
  • Loading branch information
josephmcg committed Jun 1, 2022
1 parent ae9c04b commit e49b841
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion components/views/files/view/View.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
LinkIcon,
} from 'satellite-lucide-icons'
import { RootState } from '~/types/store/store'
import { Fil } from '~/libraries/Files/Fil'
export default Vue.extend({
components: {
Expand All @@ -21,9 +22,14 @@ export default Vue.extend({
XIcon,
LinkIcon,
},
data() {
return {
file: undefined as Fil | undefined,
}
},
computed: {
...mapState({
file: (state) => (state as RootState).ui.filePreview,
filePreview: (state) => (state as RootState).ui.filePreview,
fileDownloadList: (state) => (state as RootState).ui.fileDownloadList,
blockNsfw: (state) => (state as RootState).textile.userThread.blockNsfw,
}),
Expand All @@ -34,6 +40,9 @@ export default Vue.extend({
: false
},
},
beforeMount() {
this.file = this.filePreview
},
methods: {
/**
* @method download
Expand Down

0 comments on commit e49b841

Please sign in to comment.