Enha: remove updatequeue, since it waits for another main action
This commit is contained in:
@@ -938,20 +938,18 @@ func makeFilePicker() *tview.Flex {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
filePath := path.Join(currentDisplayDir, actualItemName)
|
filePath := path.Join(currentDisplayDir, actualItemName)
|
||||||
go func() {
|
|
||||||
file, err := os.Open(filePath)
|
file, err := os.Open(filePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
app.QueueUpdate(func() { imgPreview.SetImage(nil) })
|
imgPreview.SetImage(nil)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
img, _, err := image.Decode(file)
|
img, _, err := image.Decode(file)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
app.QueueUpdate(func() { imgPreview.SetImage(nil) })
|
imgPreview.SetImage(nil)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
app.QueueUpdate(func() { imgPreview.SetImage(img) })
|
imgPreview.SetImage(img)
|
||||||
}()
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// Set up keyboard navigation
|
// Set up keyboard navigation
|
||||||
|
|||||||
Reference in New Issue
Block a user