Move the form_post auto-submit script to a frontend entrypoint

This commit is contained in:
Quentin Gliech
2026-08-07 10:25:04 +02:00
parent 28338969e1
commit ded9de23db
2 changed files with 12 additions and 1 deletions
+10
View File
@@ -0,0 +1,10 @@
// Copyright 2026 Element Creations Ltd.
//
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
// Please see LICENSE files in the repository root for full details.
// Submit the form on the next tick, so the browser can paint the
// placeholder before navigating away.
setTimeout(() => {
document.forms[0].submit();
}, 0);
+2 -1
View File
@@ -1,4 +1,5 @@
{#
Copyright 2025, 2026 Element Creations Ltd.
Copyright 2024, 2025 New Vector Ltd.
Copyright 2021-2024 The Matrix.org Foundation C.I.C.
@@ -28,5 +29,5 @@ Please see LICENSE files in the repository root for full details.
{# Submit the form in JavaScript on the next tick, so that if the browser
wants to display the placeholder instead of a blank page, it can #}
<script>setTimeout(function() { document.forms[0].submit(); }, 0);</script>
{{ include_asset('src/entrypoints/form-post.ts') | indent(2) | safe }}
{% endblock %}