fix(engine): Use context specific pageId in engine.

This commit is contained in:
SamTolmay 2021-03-11 10:18:34 +02:00
parent 601c942e4f
commit e80e461eba
3 changed files with 3 additions and 2 deletions

View File

@ -596,7 +596,7 @@ class Blocks {
}
generateBlockId(blockIdPattern) {
return `${this.context.lowdefy.pageId}:${blockIdPattern}:${Math.random()
return `${this.context.pageId}:${blockIdPattern}:${Math.random()
.toString(36)
.replace(/[^a-z]+/g, '')
.substr(0, 5)}`;

View File

@ -92,7 +92,7 @@ class Requests {
event: serializer.serialize(event) || {},
input: serializer.serialize(this.context.lowdefy.inputs[this.context.id]),
lowdefyGlobal: serializer.serialize(this.context.lowdefy.lowdefyGlobal),
pageId: this.context.lowdefy.pageId,
pageId: this.context.pageId,
state: serializer.serialize(this.context.state),
urlQuery: serializer.serialize(this.context.lowdefy.urlQuery),
},

View File

@ -75,6 +75,7 @@ const getContext = async ({ block, contextId, lowdefy }) => {
eventLog: [],
requests: {},
lowdefy,
pageId: lowdefy.pageId,
rootBlock: blockData(block), // filter block to prevent circular structure
showValidationErrors: false,
state: {},