Open chun-wen opened 11 months ago
hi I have two questions below
Below is source code Path: packages\chatbot-rasa-webchat\src\components\Widget\index.js
packages\chatbot-rasa-webchat\src\components\Widget\index.js
this.intervalId = setInterval(() => dispatch(evalUrl(window.location.href)), 500);
Path: packages\chatbot-rasa-webchat\src\store\store.js
packages\chatbot-rasa-webchat\src\store\store.js
case actionTypes.EVAL_URL: { const pageCallbacks = store.getState().behavior.get('pageChangeCallbacks'); const pageCallbacksJs = pageCallbacks ? pageCallbacks.toJS() : {}; const newUrl = action.url; if (!pageCallbacksJs.pageChanges) break; if (store.getState().behavior.get('oldUrl') !== newUrl) { const { pageChanges, errorIntent } = pageCallbacksJs; const matched = pageChanges.some((callback) => { if (callback.regex) { if (newUrl.match(callback.url)) { emitMessage(callback.callbackIntent); return true; } } else { let cleanCurrentUrl = cleanURL(newUrl); let cleanCallBackUrl = cleanURL(callback.url); if (!cleanCallBackUrl.match(/\?.+$/)) { // the callback does not have a querystring cleanCurrentUrl = trimQueryString(cleanCurrentUrl); cleanCallBackUrl = trimQueryString(cleanCallBackUrl); } if (cleanCurrentUrl === cleanCallBackUrl) { emitMessage(callback.callbackIntent); return true; } return false; } }); if (!matched) emitMessage(errorIntent); } break; }
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
hi I have two questions below
Below is source code Path:
packages\chatbot-rasa-webchat\src\components\Widget\index.js
Path:
packages\chatbot-rasa-webchat\src\store\store.js