integrate flash method into the nopaque appClient

This commit is contained in:
Patrick Jentsch
2021-02-09 15:05:49 +01:00
parent 63ec304263
commit 76e3ffb9fa
4 changed files with 39 additions and 40 deletions

View File

@ -277,11 +277,8 @@
M.AutoInit();
M.CharacterCounter.init(document.querySelectorAll('input[data-length][type="email"], input[data-length][type="password"], input[data-length][type="text"], textarea[data-length]'));
M.Dropdown.init(document.querySelectorAll('#nav-more-dropdown-trigger'), {alignment: 'right', constrainWidth: false, coverTrigger: false});
nopaque.appClient = new AppClient({% if current_user.is_authenticated %}{{ current_user.id }}{% endif %});
nopaque.Forms.init();
for (let flashedMessage of {{ get_flashed_messages(with_categories=True)|tojson }}) {nopaque.flash(flashedMessage[1], flashedMessage[0]);}
{% if current_user.is_authenticated %}
nopaque.appClient = new AppClient({{ current_user.id }});
{% endif %}
for (let flashedMessage of {{ get_flashed_messages(with_categories=True)|tojson }}) {nopaque.appClient.flash(flashedMessage[1], flashedMessage[0]);}
</script>
{% endblock scripts %}