Narrow reminder window to exact day to prevent re-fires on restart; v1.1.29
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "siteforge",
|
"name": "siteforge",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.1.28",
|
"version": "1.1.29",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
+2
-2
@@ -25,7 +25,7 @@ async function checkReminders() {
|
|||||||
if (isNaN(publish.getTime())) continue
|
if (isNaN(publish.getTime())) continue
|
||||||
const reminderDate = new Date(publish)
|
const reminderDate = new Date(publish)
|
||||||
reminderDate.setUTCDate(reminderDate.getUTCDate() - ep.reminderDays)
|
reminderDate.setUTCDate(reminderDate.getUTCDate() - ep.reminderDays)
|
||||||
if (todayKey >= toDateKey(reminderDate) && todayKey <= toDateKey(publish)) {
|
if (todayKey === toDateKey(reminderDate)) {
|
||||||
const sent = await sendReminderEmail({
|
const sent = await sendReminderEmail({
|
||||||
label: ep.episodeNumber ? `Episode ${ep.episodeNumber}` : 'Episode',
|
label: ep.episodeNumber ? `Episode ${ep.episodeNumber}` : 'Episode',
|
||||||
title: ep.title || 'Untitled',
|
title: ep.title || 'Untitled',
|
||||||
@@ -50,7 +50,7 @@ async function checkReminders() {
|
|||||||
if (isNaN(publish.getTime())) continue
|
if (isNaN(publish.getTime())) continue
|
||||||
const reminderDate = new Date(publish)
|
const reminderDate = new Date(publish)
|
||||||
reminderDate.setUTCDate(reminderDate.getUTCDate() - ev.reminderDays)
|
reminderDate.setUTCDate(reminderDate.getUTCDate() - ev.reminderDays)
|
||||||
if (todayKey >= toDateKey(reminderDate) && todayKey <= toDateKey(publish)) {
|
if (todayKey === toDateKey(reminderDate)) {
|
||||||
const sent = await sendReminderEmail({
|
const sent = await sendReminderEmail({
|
||||||
label: ev.type.charAt(0).toUpperCase() + ev.type.slice(1),
|
label: ev.type.charAt(0).toUpperCase() + ev.type.slice(1),
|
||||||
title: ev.title,
|
title: ev.title,
|
||||||
|
|||||||
Reference in New Issue
Block a user