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
|
||||
// swiping controls in that direction
|
||||
const siblings = await nav.get_siblings()
|
||||
for (let i = 0; i < siblings.length; i++) {
|
||||
if (siblings[i].name === nav.base.name) {
|
||||
swipe_prev = i > 0
|
||||
swipe_next = i < siblings.length-1
|
||||
preload(siblings[i-1])
|
||||
preload(siblings[i+1])
|
||||
break
|
||||
}
|
||||
const i = siblings.findIndex(s => s.name === nav.base.name)
|
||||
swipe_prev = i > 0
|
||||
swipe_next = i !== -1 && i < siblings.length-1
|
||||
if (i !== -1) {
|
||||
preload(siblings[i-1])
|
||||
preload(siblings[i+1])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user