wingbot 3.31.5-alpha.1 → 3.31.5-alpha.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.
- package/package.json +1 -1
- package/src/Responder.js +5 -1
- package/src/RouterWrap.js +9 -1
- package/src/utils/quickReplies.js +3 -2
package/package.json
CHANGED
package/src/Responder.js
CHANGED
|
@@ -528,6 +528,8 @@ class Responder {
|
|
|
528
528
|
if (prepend) Object.assign(prep, { _prepend: true });
|
|
529
529
|
if (justToExisting) Object.assign(prep, { _justToExisting: true });
|
|
530
530
|
|
|
531
|
+
const useCa = this.currentAction();
|
|
532
|
+
|
|
531
533
|
if (actionIsObject) {
|
|
532
534
|
this._quickReplyCollector.push({
|
|
533
535
|
...prep,
|
|
@@ -535,7 +537,8 @@ class Responder {
|
|
|
535
537
|
data: {
|
|
536
538
|
...prep.data,
|
|
537
539
|
...data
|
|
538
|
-
}
|
|
540
|
+
},
|
|
541
|
+
useCa
|
|
539
542
|
});
|
|
540
543
|
} else {
|
|
541
544
|
this._quickReplyCollector.push({
|
|
@@ -543,6 +546,7 @@ class Responder {
|
|
|
543
546
|
action: this.toAbsoluteAction(action),
|
|
544
547
|
title,
|
|
545
548
|
data,
|
|
549
|
+
useCa,
|
|
546
550
|
...prep
|
|
547
551
|
});
|
|
548
552
|
}
|
package/src/RouterWrap.js
CHANGED
|
@@ -48,6 +48,8 @@ class RouterWrap extends EventEmitter {
|
|
|
48
48
|
|
|
49
49
|
const { items, router, params } = this;
|
|
50
50
|
|
|
51
|
+
const { path, routePath } = res;
|
|
52
|
+
|
|
51
53
|
// attach params
|
|
52
54
|
req.params = params;
|
|
53
55
|
|
|
@@ -60,9 +62,15 @@ class RouterWrap extends EventEmitter {
|
|
|
60
62
|
return true;
|
|
61
63
|
}
|
|
62
64
|
|
|
65
|
+
const { path: runPath, routePath: runRoutePath } = res;
|
|
66
|
+
|
|
67
|
+
res.setPath(path, routePath);
|
|
68
|
+
|
|
63
69
|
const reducers = items.get(codeBlockName);
|
|
64
70
|
const result = await router
|
|
65
|
-
.processReducers(reducers, req, res, postBack, useAction, true);
|
|
71
|
+
.processReducers(reducers, req, res, postBack, path, useAction, true);
|
|
72
|
+
|
|
73
|
+
res.setPath(runPath, runRoutePath);
|
|
66
74
|
|
|
67
75
|
return result;
|
|
68
76
|
}
|
|
@@ -133,7 +133,8 @@ function makeQuickReplies (replies, path = '', translate = (w) => w, quickReplyC
|
|
|
133
133
|
data = {},
|
|
134
134
|
isLocation = false,
|
|
135
135
|
isEmail = false,
|
|
136
|
-
isPhone = false
|
|
136
|
+
isPhone = false,
|
|
137
|
+
useCa = currentAction
|
|
137
138
|
} = reply;
|
|
138
139
|
let {
|
|
139
140
|
setState = null
|
|
@@ -219,7 +220,7 @@ function makeQuickReplies (replies, path = '', translate = (w) => w, quickReplyC
|
|
|
219
220
|
payload = {
|
|
220
221
|
action: absoluteAction,
|
|
221
222
|
data: {
|
|
222
|
-
_ca:
|
|
223
|
+
_ca: useCa,
|
|
223
224
|
...data
|
|
224
225
|
}
|
|
225
226
|
};
|