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 8cf655b
Showing 1 changed file with 5 additions and 5 deletions.
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

0 comments on commit 8cf655b

Please sign in to comment.