fix: notifs stream reconnection
This commit is contained in:
parent
b501a7c5f0
commit
14936b8b90
5 changed files with 81 additions and 22 deletions
|
@ -33,6 +33,6 @@ async-stripe = { version = "0.41.0", features = [
|
|||
"billing",
|
||||
"runtime-tokio-hyper",
|
||||
] }
|
||||
emojis = "0.6.4"
|
||||
emojis = "0.7.0"
|
||||
webp = "0.3.0"
|
||||
bberry = "0.2.0"
|
||||
|
|
|
@ -101,6 +101,11 @@
|
|||
}
|
||||
|
||||
setTimeout(() => {
|
||||
if (globalThis.notifs_stream_init) {
|
||||
return;
|
||||
}
|
||||
|
||||
globalThis.notifs_stream_init = true;
|
||||
trigger(\"me::notifications_stream\");
|
||||
}, 250);
|
||||
});
|
||||
|
|
|
@ -47,12 +47,24 @@
|
|||
(span
|
||||
(text "{{ text \"auth:action.unfollow\" }}")))
|
||||
(text "{%- endif %} {% if not is_blocking -%}")
|
||||
(button
|
||||
("onclick" "toggle_block_user()")
|
||||
("class" "lowered red")
|
||||
(text "{{ icon \"shield\" }}")
|
||||
(span
|
||||
(text "{{ text \"auth:action.block\" }}")))
|
||||
(div
|
||||
("class" "dropdown")
|
||||
(button
|
||||
("onclick" "trigger('atto::hooks::dropdown', [event])")
|
||||
("exclude" "dropdown")
|
||||
("class" "lowered red")
|
||||
(icon_class (text "chevron-down") (text "dropdown-arrow"))
|
||||
(str (text "auth:action.block")))
|
||||
(div
|
||||
("class" "inner left")
|
||||
(button
|
||||
("onclick" "toggle_block_user()")
|
||||
(icon (text "shield"))
|
||||
(str (text "auth:action.block")))
|
||||
(button
|
||||
("onclick" "ip_block_user()")
|
||||
(icon (text "wifi"))
|
||||
(str (text "auth:action.ip_block")))))
|
||||
(text "{% else %}")
|
||||
(button
|
||||
("onclick" "toggle_block_user()")
|
||||
|
@ -151,6 +163,30 @@
|
|||
res.message,
|
||||
]);
|
||||
});
|
||||
};
|
||||
|
||||
globalThis.ip_block_user = async () => {
|
||||
if (
|
||||
!(await trigger(\"atto::confirm\", [
|
||||
\"Are you sure you would like to do this?\",
|
||||
]))
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
fetch(
|
||||
\"/api/v1/auth/user/{{ profile.id }}/block_ip\",
|
||||
{
|
||||
method: \"POST\",
|
||||
},
|
||||
)
|
||||
.then((res) => res.json())
|
||||
.then((res) => {
|
||||
trigger(\"atto::toast\", [
|
||||
res.ok ? \"success\" : \"error\",
|
||||
res.message,
|
||||
]);
|
||||
});
|
||||
};"))
|
||||
(text "{%- endif %}")
|
||||
(a
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue