Fix export of SSEManager for SSE connection
This commit is contained in:
parent
cee76ddd53
commit
303b4b826b
4 changed files with 163 additions and 7 deletions
|
|
@ -12,10 +12,12 @@
|
|||
{{ block "extraheader" . }}{{ end }}
|
||||
<script>
|
||||
const USER = {{ .User.AsJSON|json }};
|
||||
SSEManager.subscribe("*", function (e) {
|
||||
if (e.type != "heartbeat") {
|
||||
updateUserState();
|
||||
}
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
SSEManager.subscribe("*", function (e) {
|
||||
if (e.type != "heartbeat") {
|
||||
updateUserState();
|
||||
}
|
||||
});
|
||||
});
|
||||
document.addEventListener("alpine:init", () => {
|
||||
Alpine.store("user", USER);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue