mirror of
https://github.com/status-im/status-keycard-go.git
synced 2025-01-31 00:28:40 +00:00
remove confusing bool
This commit is contained in:
parent
bb5558e253
commit
8e55ed9e58
12
flow.go
12
flow.go
@ -117,15 +117,15 @@ func (f *KeycardFlow) pause(action string, status FlowStatus) {
|
||||
f.state = Paused
|
||||
}
|
||||
|
||||
func (f *KeycardFlow) pauseAndWait(action string, status FlowStatus) bool {
|
||||
func (f *KeycardFlow) pauseAndWait(action string, status FlowStatus) error {
|
||||
f.pause(action, status)
|
||||
<-f.wakeUp
|
||||
|
||||
if f.state == Resuming {
|
||||
f.state = Running
|
||||
return true
|
||||
return nil
|
||||
} else {
|
||||
return false
|
||||
return errors.New("cancel")
|
||||
}
|
||||
}
|
||||
|
||||
@ -159,11 +159,11 @@ func (f *KeycardFlow) connect() *keycardContext {
|
||||
}
|
||||
}
|
||||
|
||||
func restartOrCancel(restart bool) error {
|
||||
if restart {
|
||||
func restartOrCancel(cancel error) error {
|
||||
if cancel == nil {
|
||||
return restartErr()
|
||||
} else {
|
||||
return errors.New("cancel")
|
||||
return cancel
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user