Skip to content
This repository has been archived by the owner on Jan 30, 2025. It is now read-only.

Commit

Permalink
Refactor needsinput into a const
Browse files Browse the repository at this point in the history
  • Loading branch information
bandorko committed Mar 11, 2024
1 parent 1201f14 commit d815a2d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion common/element_handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
)

const resultDone = "done"
const resultNeedsInput = "needsinput"

type (
elementHandleActionFunc func(context.Context, *ElementHandle) (any, error)
Expand Down Expand Up @@ -271,7 +272,7 @@ func (h *ElementHandle) fill(_ context.Context, value string) error {
return fmt.Errorf("unexpected type %T", result)
}

if s == "needsinput" {
if s == resultNeedsInput {
h.frame.page.Keyboard.InsertText(value)
} else if s != resultDone {
// Either we're done or an error happened (returned as "error:..." from JS)
Expand Down

0 comments on commit d815a2d

Please sign in to comment.