Skip to content

Commit

Permalink
Convert more refresh calls to only refresh the specific item
Browse files Browse the repository at this point in the history
For #99
  • Loading branch information
Jacalz committed Dec 29, 2023
1 parent 9213d2b commit 0bd63ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion internal/transport/bridge/recv.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func (d *RecvData) NewReceive(code string) {
item.URI = storage.NewFileURI(<-path)
item.Name = item.URI.Name()
close(path)
d.list.Refresh()
d.refresh(item.index)
}()

go func(code string) {
Expand Down
8 changes: 4 additions & 4 deletions internal/transport/bridge/send.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func (d *SendData) OnFileSelect(file fyne.URIReadCloser, err error) {
}

item.Code = code
d.list.Refresh()
d.refresh(item.index)

if res := <-result; res.Error != nil {
fyne.LogError("Error on sending file", res.Error)
Expand Down Expand Up @@ -232,7 +232,7 @@ func (d *SendData) OnDirSelect(dir fyne.ListableURI, err error) {
}

item.Code = code
d.list.Refresh()
d.refresh(item.index)

if res := <-result; res.Error != nil {
fyne.LogError("Error on sending directory", res.Error)
Expand Down Expand Up @@ -261,7 +261,7 @@ func (d *SendData) NewSendFromFiles(uris []fyne.URI) {
}

item.Code = code
d.list.Refresh()
d.refresh(item.index)

if res := <-result; res.Error != nil {
fyne.LogError("Error on sending directory", res.Error)
Expand Down Expand Up @@ -295,7 +295,7 @@ func (d *SendData) SendText() {
}

item.Code = code
d.list.Refresh()
d.refresh(item.index)

if res := <-result; res.Error != nil {
fyne.LogError("Error on sending text", res.Error)
Expand Down

0 comments on commit 0bd63ef

Please sign in to comment.