mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
fix(api): add check contextValue check
This commit is contained in:
parent
3d7975ee15
commit
b208afb508
@ -114,16 +114,18 @@ export class ConversationService extends BaseService<
|
||||
contextValue =
|
||||
typeof contextValue === 'string' ? contextValue.trim() : contextValue;
|
||||
|
||||
if (
|
||||
profile.context?.vars &&
|
||||
contextVars[capture.context_var]?.permanent
|
||||
) {
|
||||
Logger.debug(
|
||||
`Adding context var to subscriber: ${capture.context_var} = ${contextValue}`,
|
||||
);
|
||||
profile.context.vars[capture.context_var] = contextValue;
|
||||
if (contextValue) {
|
||||
if (
|
||||
profile.context?.vars &&
|
||||
contextVars[capture.context_var]?.permanent
|
||||
) {
|
||||
Logger.debug(
|
||||
`Adding context var to subscriber: ${capture.context_var} = ${contextValue}`,
|
||||
);
|
||||
profile.context.vars[capture.context_var] = contextValue;
|
||||
}
|
||||
convo.context!.vars[capture.context_var] = contextValue;
|
||||
}
|
||||
convo.context!.vars[capture.context_var] = contextValue;
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user