Update JS code structure

This commit is contained in:
Patrick Jentsch
2024-12-02 09:34:17 +01:00
parent a2904caea2
commit 12a3ac1d5d
21 changed files with 295 additions and 242 deletions

View File

@ -9,6 +9,8 @@
output='gen/nopaque.%(version)s.js',
'js/index.js',
'js/app.js',
'js/app.ui.js',
'js/app.users.js',
'js/utils.js',
'js/forms/index.js',
@ -82,11 +84,11 @@
const currentUserId = {{ current_user.hashid|tojson }};
// Subscribe to the current user's data events
app.subscribeUser(currentUserId)
app.users.subscribe(currentUserId)
.catch((error) => {throw JSON.stringify(error);});
// Get the current user's data
app.getUser(currentUserId, true, true)
app.users.get(currentUserId, true, true)
.catch((error) => {throw JSON.stringify(error);});
{% if not current_user.terms_of_use_accepted -%}
@ -96,7 +98,7 @@
// Display flashed messages
for (let [category, message] of {{ get_flashed_messages(with_categories=True)|tojson }}) {
app.flash(message, message);
app.ui.flash(message, message);
}
</script>