fix: notifs stream reconnection

This commit is contained in:
trisua 2025-06-30 12:20:44 -04:00
parent b501a7c5f0
commit 14936b8b90
5 changed files with 81 additions and 22 deletions

View file

@ -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