Fix issue where swiping a shared image without a directory made it disappear
This commit is contained in:
@@ -52,14 +52,12 @@ export const update = async () => {
|
|||||||
// Figure out if there are previous or next files. If not then we disable
|
// Figure out if there are previous or next files. If not then we disable
|
||||||
// swiping controls in that direction
|
// swiping controls in that direction
|
||||||
const siblings = await nav.get_siblings()
|
const siblings = await nav.get_siblings()
|
||||||
for (let i = 0; i < siblings.length; i++) {
|
const i = siblings.findIndex(s => s.name === nav.base.name)
|
||||||
if (siblings[i].name === nav.base.name) {
|
swipe_prev = i > 0
|
||||||
swipe_prev = i > 0
|
swipe_next = i !== -1 && i < siblings.length-1
|
||||||
swipe_next = i < siblings.length-1
|
if (i !== -1) {
|
||||||
preload(siblings[i-1])
|
preload(siblings[i-1])
|
||||||
preload(siblings[i+1])
|
preload(siblings[i+1])
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user