dify icon indicating copy to clipboard operation
dify copied to clipboard

When input is no variables, the run button disappear.

Open steveGuRen opened this issue 8 months ago • 1 comments

Self Checks

  • [x] This is only for bug report, if you would like to ask a question, please head to Discussions.
  • [x] I have searched for existing issues search for existing issues, including closed ones.
  • [x] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • [x] Please do not modify this template :) and fill in all the required fields.

Dify version

1.2.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Image upgrade from 1.1.3

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

steveGuRen avatar Apr 10 '25 09:04 steveGuRen

The issue you're experiencing, where the run button disappears when there are no variables in the input on version 1.2.0 of the self-hosted Dify application, is due to a specific condition in the code. The checkCanSend function returns true when there are no prompt_variables or when their length is zero. This condition bypasses the checks for required variables and file uploads, leading to the function returning true prematurely, which might be interpreted by the UI logic as a condition to disable the run button [1].

Additionally, there is logic in the code that explicitly hides the run button when there are no prompt variables. This is done by checking if the inputs object is null, undefined, or has no keys. If any of these conditions are true, the component returns null, effectively hiding the run button and the rest of the form [2].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

dosubot[bot] avatar Apr 10 '25 09:04 dosubot[bot]