Skip to content

Commit 245384e

Browse files
committed
optimize UpdateBreakPoint
1 parent 80a60b2 commit 245384e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.UpdateBreakpoint.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace BotSharp.Core.Conversations.Services;
44

55
public partial class ConversationService : IConversationService
66
{
7-
public async Task UpdateBreakpoint(bool resetStates = false, string? reason = null)
7+
public async Task UpdateBreakpoint(bool resetStates = false, string? reason = null, params string[] excludedStates)
88
{
99
var db = _services.GetRequiredService<IBotSharpRepository>();
1010
var routingCtx = _services.GetRequiredService<IRoutingContext>();
@@ -22,7 +22,8 @@ public async Task UpdateBreakpoint(bool resetStates = false, string? reason = nu
2222
{
2323
var states = _services.GetRequiredService<IConversationStateService>();
2424
// keep language state
25-
states.CleanStates(StateConst.LANGUAGE);
25+
if(excludedStates.IsNullOrEmpty()) excludedStates = new string[] { StateConst.LANGUAGE };
26+
states.CleanStates(excludedStates);
2627
}
2728

2829
var hooks = _services.GetServices<IConversationHook>()

0 commit comments

Comments
 (0)