@miso.ai/client-sdk-ui 1.9.6-beta.0 → 1.9.6-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,4 +4,4 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _default = exports.default = '1.9.6-beta.0';
7
+ var _default = exports.default = '1.9.6-beta.2';
@@ -194,7 +194,8 @@ class Ask extends _base.default {
194
194
  _defaultProcessData(data) {
195
195
  data = super._defaultProcessData(data);
196
196
  const {
197
- value
197
+ value,
198
+ request
198
199
  } = data;
199
200
  if (!value) {
200
201
  return data;
@@ -203,6 +204,7 @@ class Ask extends _base.default {
203
204
  question_id: questionId,
204
205
  question
205
206
  } = value;
207
+ const organic = request && request.payload && request.payload._meta && request.payload._meta.question_source === _constants.ORGANIC_QUESTION_SOURCE;
206
208
 
207
209
  // capture question ID and register at context
208
210
  if (!this._questionId && questionId) {
@@ -215,7 +217,7 @@ class Ask extends _base.default {
215
217
  const url = new URL(window.location);
216
218
  const currentQuestion = url.searchParams.get('q');
217
219
  // TODO: review this, handle &s=
218
- if (question !== currentQuestion && (currentQuestion || this._autoQuery.updateUrl === true)) {
220
+ if (question !== currentQuestion && (!organic || this._autoQuery.updateUrl === true)) {
219
221
  url.searchParams.set('q', question);
220
222
  window.history.replaceState({}, '', url);
221
223
  }
package/package.json CHANGED
@@ -26,7 +26,7 @@
26
26
  "url": "https://github.com/MisoAI/miso-client-js-sdk/issues"
27
27
  },
28
28
  "dependencies": {
29
- "@miso.ai/commons": "1.9.6-beta.0"
29
+ "@miso.ai/commons": "1.9.6-beta.2"
30
30
  },
31
- "version": "1.9.6-beta.0"
31
+ "version": "1.9.6-beta.2"
32
32
  }
package/src/version.js CHANGED
@@ -1 +1 @@
1
- export default '1.9.6-beta.0';
1
+ export default '1.9.6-beta.2';
@@ -157,11 +157,12 @@ export default class Ask extends Workflow {
157
157
 
158
158
  _defaultProcessData(data) {
159
159
  data = super._defaultProcessData(data);
160
- const { value } = data;
160
+ const { value, request } = data;
161
161
  if (!value) {
162
162
  return data;
163
163
  }
164
164
  const { question_id: questionId, question } = value;
165
+ const organic = request && request.payload && request.payload._meta && request.payload._meta.question_source === ORGANIC_QUESTION_SOURCE;
165
166
 
166
167
  // capture question ID and register at context
167
168
  if (!this._questionId && questionId) {
@@ -174,7 +175,7 @@ export default class Ask extends Workflow {
174
175
  const url = new URL(window.location);
175
176
  const currentQuestion = url.searchParams.get('q');
176
177
  // TODO: review this, handle &s=
177
- if (question !== currentQuestion && (currentQuestion || this._autoQuery.updateUrl === true)) {
178
+ if (question !== currentQuestion && (!organic || this._autoQuery.updateUrl === true)) {
178
179
  url.searchParams.set('q', question);
179
180
  window.history.replaceState({}, '', url);
180
181
  }