forked from andyburke/autonomous.contact
feature: watches on the backend, need frontend implementation for
notifications and unread indicators
This commit is contained in:
parent
7046bb0389
commit
6293374bb7
28 changed files with 1405 additions and 608 deletions
|
|
@ -32,12 +32,8 @@
|
|||
{
|
||||
const feed = document.currentScript.closest("[data-feed]");
|
||||
|
||||
document.addEventListener("topic_changed", () => {
|
||||
feed.__reset && feed.__reset();
|
||||
});
|
||||
document.addEventListener("user_logged_in", () => {
|
||||
feed.__reset && feed.__reset();
|
||||
});
|
||||
APP.on("topic_changed", () => { feed.__reset && feed.__reset(); });
|
||||
APP.on("user_logged_in", () => { feed.__reset && feed.__reset(); });
|
||||
|
||||
const time_tick_tock_timeout = 60_000;
|
||||
|
||||
|
|
@ -71,7 +67,7 @@
|
|||
|
||||
return {
|
||||
event: item,
|
||||
creator: await USERS.get(item.creator_id),
|
||||
creator: await APP.USERS.get(item.creator_id),
|
||||
event_datetime,
|
||||
time_tick_tock_class,
|
||||
user_tick_tock_class,
|
||||
|
|
@ -165,12 +161,9 @@
|
|||
<script>
|
||||
{
|
||||
const form = document.currentScript.closest("form");
|
||||
document.addEventListener(
|
||||
"topic_changed",
|
||||
({ detail: { topic_id } }) => {
|
||||
form.action = topic_id ? `/api/topics/${topic_id}/events` : "";
|
||||
},
|
||||
);
|
||||
APP.on( "topic_changed", ({ topic_id }) => {
|
||||
form.action = topic_id ? `/api/topics/${topic_id}/events` : "";
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
@ -192,7 +185,7 @@
|
|||
<input
|
||||
type="hidden"
|
||||
name="creator_id"
|
||||
generator="() => { return JSON.parse( document.body.dataset.user ?? '{}' ).id; }"
|
||||
generator="() => { return APP.user?.id; }"
|
||||
/>
|
||||
|
||||
<input
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue