From 8ca86e72dc7db8bf7999a6ecd631db075cd0bdbb Mon Sep 17 00:00:00 2001 From: Arushi Gupta Date: Mon, 5 Oct 2026 21:54:11 +0530 Subject: [PATCH] changing referrr basis the user action --- .../workflow/workflow-prompt-upload/action-binder.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/unitylibs/core/workflow/workflow-prompt-upload/action-binder.js b/unitylibs/core/workflow/workflow-prompt-upload/action-binder.js index 55bfeec2f..068974dcc 100644 --- a/unitylibs/core/workflow/workflow-prompt-upload/action-binder.js +++ b/unitylibs/core/workflow/workflow-prompt-upload/action-binder.js @@ -588,14 +588,24 @@ export default class ActionBinder { }); } + getApiClientLocation(hasFiles, hasPrompt) { + const workflow = this.workflowCfg.enabledFeatures[0]; + if (hasFiles && hasPrompt) return `${workflow}-prompt-source`; + if (hasPrompt) return `${workflow}-prompt`; + return workflow; + } + async handleRedirect(cOpts, filesData) { if (this.query) { cOpts.query = this.promptPrefix ? `${this.promptPrefix} ${this.query}` : this.query; } + const hasFiles = this.pendingFiles?.length > 0; + const hasPrompt = !!this.query; + if (this.optionValue && this.optionKey) cOpts.payload[this.optionKey] = this.optionValue; - [cOpts.payload.referrer] = this.workflowCfg.enabledFeatures; + cOpts.payload.referrer = this.getApiClientLocation(hasFiles,hasPrompt); try { cOpts.payload.newUser = !localStorage.getItem('unity.user'); const numAttempts = parseInt(localStorage.getItem(`${this.workflowCfg.enabledFeatures[0]}_attempts`), 10) || 0;