mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-24 10:34:17 +00:00
Only initialize socket when the user is logged in
This commit is contained in:
parent
afd7469178
commit
ecac2c481c
@ -216,6 +216,4 @@ document.addEventListener("DOMContentLoaded", function() {
|
||||
flashedMessage = nopaque.flashedMessages.shift();
|
||||
nopaque.flash(flashedMessage[1], flashedMessage[0]);
|
||||
}
|
||||
nopaque.socket.init();
|
||||
nopaque.socket.emit("user_data_stream_init");
|
||||
});
|
||||
|
@ -237,7 +237,10 @@
|
||||
<script src="{{ url_for('static', filename='js/Materialize/materialize.min.js') }}"></script>
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
|
||||
{% if current_user.is_authenticated %}
|
||||
nopaque.socket.init();
|
||||
nopaque.socket.emit("user_data_stream_init");
|
||||
{% endif %}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
Loading…
Reference in New Issue
Block a user