mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-17 19:26:23 +00:00
removed ctx
This commit is contained in:
@@ -7,18 +7,6 @@ class FlowClass {
|
||||
flowRaw = []
|
||||
constructor(_flow) {
|
||||
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.allContexts = _flow
|
||||
.map((ctxs) => ctxs.ctx.contexts)
|
||||
|
||||
Reference in New Issue
Block a user