correctly set current image state on new dir load
This commit is contained in:
5
main.go
5
main.go
@@ -92,9 +92,14 @@ func newBrowse(file string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
directoryState.images = []string{}
|
directoryState.images = []string{}
|
||||||
|
i := 0
|
||||||
for _, v := range dirfiles {
|
for _, v := range dirfiles {
|
||||||
if filetypes.IsImage(v) {
|
if filetypes.IsImage(v) {
|
||||||
directoryState.images = append(directoryState.images, v.Name())
|
directoryState.images = append(directoryState.images, v.Name())
|
||||||
|
if filepath.Join(directoryState.dir, v.Name()) == file {
|
||||||
|
directoryState.i = i
|
||||||
|
}
|
||||||
|
i++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
updateImage(file)
|
updateImage(file)
|
||||||
|
Reference in New Issue
Block a user