diff --git a/internal/quickstart/create_flag.go b/internal/quickstart/create_flag.go index 5b8018c1..d7bc76aa 100644 --- a/internal/quickstart/create_flag.go +++ b/internal/quickstart/create_flag.go @@ -84,8 +84,8 @@ func (m createFlagModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { } case createdFlagMsg: m.showSuccessView = true - m.existingFlagUsed = msg.existingFlagUsed m.flag = msg.flag + m.existingFlagUsed = msg.existingFlag case errMsg: m.err = msg.err } diff --git a/internal/quickstart/messages.go b/internal/quickstart/messages.go index 87697b0c..e87ed60b 100644 --- a/internal/quickstart/messages.go +++ b/internal/quickstart/messages.go @@ -46,8 +46,8 @@ func toggleFlag(client flags.Client, accessToken, baseUri, flagKey string, enabl } type createdFlagMsg struct { - flag flag - existingFlagUsed bool + flag flag + existingFlag bool } type confirmedFlagMsg struct { @@ -92,7 +92,6 @@ func (e msgRequestError) IsConflict() bool { func createFlag(client flags.Client, accessToken, baseUri, flagName, flagKey, projKey string) tea.Cmd { return func() tea.Msg { var existingFlag bool - _, err := client.Create( context.Background(), accessToken, @@ -116,13 +115,15 @@ func createFlag(client flags.Client, accessToken, baseUri, flagName, flagKey, pr ), ), } + } else { + existingFlag = true } } return createdFlagMsg{flag: flag{ key: flagKey, name: flagName, - }, existingFlagUsed: existingFlag} + }, existingFlag: existingFlag} } } diff --git a/internal/quickstart/toggle_flag.go b/internal/quickstart/toggle_flag.go index 50576a18..22222891 100644 --- a/internal/quickstart/toggle_flag.go +++ b/internal/quickstart/toggle_flag.go @@ -92,7 +92,7 @@ func (m toggleFlagModel) View() string { toggle = "ON" } - if m.flagWasEnabled { + if m.flagWasEnabled && m.err == nil { furtherInstructions = fmt.Sprintf("\n\nCheck your %s to see the change!", logTypeMap[m.sdkKind]) }