Enha: remove updatequeue, since it waits for another main action

This commit is contained in:
Grail Finder
2026-02-17 10:29:28 +03:00
parent 7b2fa04391
commit fa846225ee

View File

@@ -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