summaryrefslogtreecommitdiff
path: root/cmd/rescribe
diff options
context:
space:
mode:
authorNick White <git@njw.name>2022-03-21 17:31:32 +0000
committerNick White <git@njw.name>2022-03-21 17:31:32 +0000
commite2b8e8fd0be69ffb3256696b534cc226660aa7b3 (patch)
tree478158ac8b55342238e03ad57be0612808633b0d /cmd/rescribe
parent63b6942f6b2649c70c30cdced6c033ff2607724f (diff)
rescribe: fix bug in gui where choosing "other" then cancelling would leave the "other" training selected
Diffstat (limited to 'cmd/rescribe')
-rw-r--r--cmd/rescribe/gui.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/cmd/rescribe/gui.go b/cmd/rescribe/gui.go
index a9d5fbb..f96a342 100644
--- a/cmd/rescribe/gui.go
+++ b/cmd/rescribe/gui.go
@@ -128,6 +128,7 @@ func trainingSelectOnChange(sel *widget.Select, parent fyne.Window) func(string)
}
d := dialog.NewFileOpen(func(uri fyne.URIReadCloser, err error) {
if err != nil || uri == nil {
+ sel.SetSelectedIndex(0)
return
}
defer uri.Close()
@@ -136,12 +137,14 @@ func trainingSelectOnChange(sel *widget.Select, parent fyne.Window) func(string)
f, err := os.Create(newpath)
if err != nil {
// TODO: surface error somewhere, prob with a dialog box
+ sel.SetSelectedIndex(0)
return
}
defer f.Close()
_, err = io.Copy(f, uri)
if err != nil {
// TODO: surface error somewhere, prob with a dialog box
+ sel.SetSelectedIndex(0)
return
}