Skip to content

Commit

Permalink
change variable name from delay to duration
Browse files Browse the repository at this point in the history
  • Loading branch information
oshorefueled committed Aug 17, 2021
1 parent fb1f77a commit a106bc7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
Empty file removed ui/components.go
Empty file.
10 changes: 5 additions & 5 deletions ui/notification/toast.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ type Toast struct {
timer *time.Timer
}

type delay int32
type duration int32

const (
Short delay = iota
Short duration = iota
Long
)

Expand All @@ -37,7 +37,7 @@ func NewToast(th *decredmaterial.Theme) *Toast {
}
}

func getDurationFromDelay(d delay) time.Duration {
func getDurationFromDelay(d duration) time.Duration {
switch d {
case Short:
return 2 * time.Second
Expand All @@ -48,8 +48,8 @@ func getDurationFromDelay(d delay) time.Duration {
}
}

func (t *Toast) Notify(message string, success bool, d ...delay) {
var notificationDelay delay
func (t *Toast) Notify(message string, success bool, d ...duration) {
var notificationDelay duration
if len(d) > 0 {
notificationDelay = d[0]
}
Expand Down
2 changes: 1 addition & 1 deletion ui/page/proposal/proposal_vote_modal.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func (vm *voteModal) sendVotes() {
return
}
pm.Dismiss()
vm.CreateToast("Vote sent successfully, refreshing proposals!", true)
vm.Toast.Notify("Vote sent successfully, refreshing proposals!", true)
go vm.WL.MultiWallet.Politeia.Sync()
vm.Dismiss()
}()
Expand Down
5 changes: 1 addition & 4 deletions ui/page/start_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@ package page
import (
"os"

"github.com/planetdecred/godcr/ui/load"
"github.com/planetdecred/godcr/ui/modal"

"gioui.org/layout"
"gioui.org/text"
"gioui.org/widget"

"github.com/planetdecred/dcrlibwallet"
"github.com/planetdecred/godcr/ui/decredmaterial"
"github.com/planetdecred/godcr/ui/load"
"github.com/planetdecred/godcr/ui/page"
"github.com/planetdecred/godcr/ui/modal"
"github.com/planetdecred/godcr/ui/values"
)

Expand Down

0 comments on commit a106bc7

Please sign in to comment.