From 827566d57d4c0a3c89734d4248ed3762c941e324 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Tue, 21 Jul 2026 04:31:12 +0200 Subject: [PATCH] Integrated e-mail alerts, added dialog option for release alerts. --- components/alerts/create.vue | 68 ++++++- components/emails/alert.vue | 339 +++++++++++++++----------------- components/stashes/heart.vue | 7 +- components/user/preferences.vue | 35 +++- pages/users/@username/+Page.vue | 4 +- pages/users/@username/+route.js | 2 +- src/alerts.js | 276 +++++++++++++++++--------- src/app.js | 2 + src/stashes.js | 26 +-- src/users.js | 11 +- tools/notify.js | 25 +++ 11 files changed, 487 insertions(+), 308 deletions(-) create mode 100644 tools/notify.js diff --git a/components/alerts/create.vue b/components/alerts/create.vue index 3e7b9ef..22f0f54 100644 --- a/components/alerts/create.vue +++ b/components/alerts/create.vue @@ -1,4 +1,5 @@ + v-if="trigger.alertEntities.length > 0" + >for {{ trigger.alertEntities[0].name }}  + v-if="trigger.alertMatches.length > 0" + >matching {{ trigger.alertMatches.map((match) => match.expression).join(', ') }} @@ -249,7 +228,7 @@ const mockTrigger = { valign="top" style="text-align: right;" > - #{{ alert.alert.id }} + #{{ trigger.alertId }} @@ -259,12 +238,12 @@ const mockTrigger = { width="175" valign="top" > - + @@ -278,17 +257,17 @@ const mockTrigger = {
{{ alert.scene.title }} + >{{ trigger.scene.title }}
- {{ alert.scene.actors.slice(0, 3).map((actor) => actor.name).join(', ') }} + {{ trigger.scene.actors.slice(0, 3).map((actor) => actor.name).join(', ') }}
- {{ alert.scene.tags.slice(0, 5).map((tag) => tag.name).join(', ') }} + {{ trigger.scene.tags.slice(0, 5).map((tag) => tag.name).join(', ') }}
diff --git a/components/stashes/heart.vue b/components/stashes/heart.vue index 5427f6e..fe3831a 100644 --- a/components/stashes/heart.vue +++ b/components/stashes/heart.vue @@ -125,6 +125,9 @@ async function alertItem() { ...(props.domain === 'scenes' && { scenes: [props.item.id] }), notify: true, email: false, + // probably too confusing and annoying to have quick alerts inherit email preference from dialog + // notify: JSON.parse(localStorage.getItem('alert_notify')) ?? true, + // email: JSON.parse(localStorage.getItem('alert_email')) ?? false, preset: true, }, { successFeedback: `Alert set for '${alertLabel}'`, @@ -173,7 +176,7 @@ async function removeAlert() { function setAlerted(alert) { // only set alerted status if the current item is the only one in the new stash - const items = [...alert.actors, ...alert.tags, ...alert.entities, ...alert.matches]; + const items = [...alert.actors, ...alert.tags, ...alert.entities, ...alert.matches, ...alert.scenes]; if (items.length === 1 && alert[props.domain][0]?.id === props.item.id) { itemAlerted.value = true; @@ -219,7 +222,6 @@ async function reloadStashes(newStash) { icon="bell2" class="alert active noselect" @click="removeAlert" - @contextmenu.prevent="showAlertDialog = true" /> +

Alerts

+
- Enable alert e-mails - Whether you receive e-mail alerts + Enable alert notifications + Your alerts can trigger notifications in traxxx + +
+ +
+ + Enable alert e-mails + Your alerts can trigger e-mails + + + +
@@ -39,12 +58,12 @@ async function updateSettings() {