diff --git a/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.UpdateBreakpoint.cs b/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.UpdateBreakpoint.cs index 7453a202..1bee7b89 100644 --- a/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.UpdateBreakpoint.cs +++ b/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.UpdateBreakpoint.cs @@ -4,7 +4,7 @@ namespace BotSharp.Core.Conversations.Services; public partial class ConversationService : IConversationService { - public async Task UpdateBreakpoint(bool resetStates = false, string? reason = null) + public async Task UpdateBreakpoint(bool resetStates = false, string? reason = null, params string[] excludedStates) { var db = _services.GetRequiredService(); var routingCtx = _services.GetRequiredService(); @@ -22,7 +22,8 @@ public partial class ConversationService : IConversationService { var states = _services.GetRequiredService(); // keep language state - states.CleanStates(StateConst.LANGUAGE); + if(excludedStates.IsNullOrEmpty()) excludedStates = new string[] { StateConst.LANGUAGE }; + states.CleanStates(excludedStates); } var hooks = _services.GetServices()