fix(ai): Don't override default modalExampleQuestions unless they're defined in products.yml.
parent
c173edce68
commit
fe7a2e0739
|
@ -78,7 +78,7 @@ function initializeChat({onChatLoad, chatAttributes}) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getProductExampleQuestions() {
|
function getProductExampleQuestions() {
|
||||||
const questions = productData?.product?.ai_sample_questions || null;
|
const questions = productData?.product?.ai_sample_questions;
|
||||||
return questions?.join(',') || '';
|
return questions?.join(',') || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,8 +88,10 @@ function getProductExampleQuestions() {
|
||||||
* userid: optional, a unique user ID for the user (not currently used for public docs)
|
* userid: optional, a unique user ID for the user (not currently used for public docs)
|
||||||
*/
|
*/
|
||||||
export default function AskAI({ userid, email, onChatLoad, ...chatParams }) {
|
export default function AskAI({ userid, email, onChatLoad, ...chatParams }) {
|
||||||
|
|
||||||
|
const modalExampleQuestions = getProductExampleQuestions();
|
||||||
const chatAttributes = {
|
const chatAttributes = {
|
||||||
modalExampleQuestions: getProductExampleQuestions(),
|
...(modalExampleQuestions && { modalExampleQuestions }),
|
||||||
...chatParams,
|
...chatParams,
|
||||||
}
|
}
|
||||||
initializeChat({onChatLoad, chatAttributes});
|
initializeChat({onChatLoad, chatAttributes});
|
||||||
|
|
Loading…
Reference in New Issue