Fix double POST on open position in embed shell mode.
Embed capture-phase form handler and allowManualOrderSubmit both submitted /add_order; skip custom forms and use a single fetch reload path. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -889,6 +889,10 @@ function cancelExchangeTpsl(orderId, role){
|
||||
|
||||
function allowManualOrderSubmit(form){
|
||||
form.dataset.rrOk = "1";
|
||||
if(document.body && document.body.getAttribute("data-embed-shell") === "1" && window.InstanceEmbed && window.InstanceEmbed.postFormAndReload){
|
||||
window.InstanceEmbed.postFormAndReload(form, "开仓提交中…");
|
||||
return;
|
||||
}
|
||||
if(window.FormSubmitGuard){
|
||||
if(FormSubmitGuard.isLocked(form)){
|
||||
FormSubmitGuard.setSubmitLabel(form, "开仓提交中…");
|
||||
|
||||
@@ -115,6 +115,6 @@
|
||||
<script src="/static/manual_order_rr_preview.js?v=3"></script>
|
||||
<script src="/static/key_monitor_form.js?v=1"></script>
|
||||
{% include 'embed_boot_scripts.html' %}
|
||||
<script src="/static/instance_embed.js?v=3"></script>
|
||||
<script src="/static/instance_embed.js?v=4"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user