feat: custom action decision

This commit is contained in:
karishmas6
2024-06-07 23:50:11 +05:30
parent f62191a56e
commit 971b8c0abc

View File

@@ -99,6 +99,19 @@ export class WorkflowGenerator {
socket.on('activeIndex', (data) => this.generatedData.lastIndex = parseInt(data));
socket.on('decision', async ({pair, actionType, decision}) => {
const id = browserPool.getActiveBrowserId();
if (id) {
const activeBrowser = browserPool.getRemoteBrowser(id);
const currentPage = activeBrowser?.getCurrentPage();
if (decision) {
switch (actionType) {
case 'customAction':
pair.where.selectors = [this.generatedData.lastUsedSelector];
break;
}
}
}
})
};