mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 13:21:00 +02:00
use oncompletion
This commit is contained in:
parent
826154caa2
commit
457d8b18ad
2 changed files with 4 additions and 1 deletions
|
@ -208,6 +208,9 @@ func (s *Session) receiveData(pathToFile string, fileSize int64) error {
|
||||||
s.spinner.Stop()
|
s.spinner.Stop()
|
||||||
bar = progressbar.NewOptions64(
|
bar = progressbar.NewOptions64(
|
||||||
fileSize,
|
fileSize,
|
||||||
|
progressbar.OptionOnCompletion(func() {
|
||||||
|
fmt.Println(" sent.")
|
||||||
|
}),
|
||||||
progressbar.OptionSetWidth(8),
|
progressbar.OptionSetWidth(8),
|
||||||
progressbar.OptionSetDescription(fname),
|
progressbar.OptionSetDescription(fname),
|
||||||
progressbar.OptionSetRenderBlankState(true),
|
progressbar.OptionSetRenderBlankState(true),
|
||||||
|
|
|
@ -265,7 +265,7 @@ func (s *Session) onBufferedAmountLow() func() {
|
||||||
s.bar = progressbar.NewOptions64(
|
s.bar = progressbar.NewOptions64(
|
||||||
s.fileSize,
|
s.fileSize,
|
||||||
progressbar.OptionOnCompletion(func() {
|
progressbar.OptionOnCompletion(func() {
|
||||||
fmt.Println(" done")
|
fmt.Println(" sent.")
|
||||||
}),
|
}),
|
||||||
progressbar.OptionSetWidth(8),
|
progressbar.OptionSetWidth(8),
|
||||||
progressbar.OptionSetDescription(s.fname),
|
progressbar.OptionSetDescription(s.fname),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue