From 1592cf3b1b5ee59b4a7eec2751baa21393aa61aa Mon Sep 17 00:00:00 2001 From: Balazs Andorko Date: Mon, 11 Mar 2024 14:23:55 +0100 Subject: [PATCH] Refactor needsinput into a const --- common/element_handle.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/element_handle.go b/common/element_handle.go index 8ef62e535..d206c65c9 100644 --- a/common/element_handle.go +++ b/common/element_handle.go @@ -24,6 +24,7 @@ import ( ) const resultDone = "done" +const resultNeedsInput = "needsinput" type ( elementHandleActionFunc func(context.Context, *ElementHandle) (any, error) @@ -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)