fix: state clear
This commit is contained in:
1 parent
ec12f29fdb
commit
cb1ed91e05
2 files changed
+12
-10
No files matched your search
@@ -176,17 +176,15 @@ func (d *Dispatcher) handleUpdate(ctx context.Context, upd model.Update) {
|
||||
}
|
||||
|
||||
st = c.State()
|
||||
if st.State() == state.ClearState {
|
||||
if st.IsEmpty() {
|
||||
if err := d.fsmStorage.Delete(ctx, isolation.Scope{UserID: upd.UserID, ChatID: upd.ChatID}); err != nil {
|
||||
log.Error().Err(err).Send()
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
if st.State() != "" {
|
||||
if err := d.fsmStorage.Put(ctx, st.Snapshot()); err != nil {
|
||||
log.Error().Err(err).Send()
|
||||
return
|
||||
}
|
||||
|
||||
if err := d.fsmStorage.Put(ctx, st.Snapshot()); err != nil {
|
||||
log.Error().Err(err).Send()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user