Skip to content

Commit 98964af

Browse files
fix(ImageViewer): Resolve file download issue IceWhaleTech/CasaOS#2210 (#248)
In the `ImageViewer.vue` component, the original download functionality utilized the mixin's download function, which relied on `props.item.path`. This path remains static and isn't updated by the `next` and `prev` functions, leading to incorrect file downloads. To fix this, the download function in `ImageViewer.vue` has been overridden. The updated implementation now uses `data.currentItem.path`, which dynamically changes with the `next` and `prev` functions, ensuring accurate file downloads. Close [#2210](IceWhaleTech/CasaOS#2210)
1 parent 2c6a312 commit 98964af

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/components/filebrowser/viewers/ImageViewer.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ export default {
164164
this.viewer.show()
165165
this.onMouseMove()
166166
},
167+
download() {
168+
this.$refs.dropDown?.toggle()
169+
this.downloadFile(this.currentItem)
170+
},
167171
next() {
168172
if (this.currentItemIndex < this.itemList.length - 1) {
169173
this.currentItemIndex++

0 commit comments

Comments
 (0)