mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-20 12:39:24 +00:00
removed ctx
This commit is contained in:
@@ -7,18 +7,6 @@ class FlowClass {
|
|||||||
flowRaw = []
|
flowRaw = []
|
||||||
constructor(_flow) {
|
constructor(_flow) {
|
||||||
if (!Array.isArray(_flow)) throw new Error('Esto debe ser un ARRAY')
|
if (!Array.isArray(_flow)) throw new Error('Esto debe ser un ARRAY')
|
||||||
_flow.forEach((ctxFlow, parentIndex) => {
|
|
||||||
const callbacks = ctxFlow.ctx?.callbacks || []
|
|
||||||
const contexts = ctxFlow.ctx?.contexts || []
|
|
||||||
|
|
||||||
callbacks.forEach((deepCallbacks) => {
|
|
||||||
if (deepCallbacks && contexts[parentIndex]) {
|
|
||||||
const ctxChild = contexts[parentIndex]
|
|
||||||
deepCallbacks.callback(null, ctxChild)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
this.flowRaw = _flow
|
this.flowRaw = _flow
|
||||||
this.allContexts = _flow
|
this.allContexts = _flow
|
||||||
.map((ctxs) => ctxs.ctx.contexts)
|
.map((ctxs) => ctxs.ctx.contexts)
|
||||||
|
|||||||
Reference in New Issue
Block a user