From 16f37cb459b4aa2d24fa194bb40fd8a4e6541f93 Mon Sep 17 00:00:00 2001 From: Michele Balistreri Date: Tue, 30 Aug 2022 09:02:17 +0200 Subject: [PATCH] only send card inserted if sent insertcard before --- flow.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/flow.go b/flow.go index 60e2564..8449bae 100644 --- a/flow.go +++ b/flow.go @@ -201,8 +201,11 @@ func (f *KeycardFlow) connect() (*keycardContext, error) { return nil, restartErr() } t.Stop() - f.state = Running - signal.Send(CardInserted, FlowStatus{}) + if f.state == Paused { + f.state = Running + signal.Send(CardInserted, FlowStatus{}) + } + return kc, nil case <-t.C: f.pause(InsertCard, ErrorConnection, FlowParams{})