From 87bf526dc6a274797ab6cf088ba4f4cbc64dcb5e Mon Sep 17 00:00:00 2001 From: SethBurkart123 Date: Wed, 7 May 2025 20:28:39 +1000 Subject: [PATCH] feat: update job title --- src/interface/components/Switch.svelte | 2 +- .../built-in/globalSearch/src/indexing/jobs.ts | 4 ++-- .../jobs/{assessments.ts => notifications.ts} | 17 ++++++++--------- 3 files changed, 11 insertions(+), 12 deletions(-) rename src/plugins/built-in/globalSearch/src/indexing/jobs/{assessments.ts => notifications.ts} (93%) diff --git a/src/interface/components/Switch.svelte b/src/interface/components/Switch.svelte index 6fe91cbf..a56a287c 100644 --- a/src/interface/components/Switch.svelte +++ b/src/interface/components/Switch.svelte @@ -50,6 +50,6 @@ } .dark .switch[data-ison="true"] { - @apply from-[#30D259]/50 to-[#30D259]; + @apply from-[#30D259]/40 to-[#30D259]; } diff --git a/src/plugins/built-in/globalSearch/src/indexing/jobs.ts b/src/plugins/built-in/globalSearch/src/indexing/jobs.ts index 7d2c5506..6a819a9a 100644 --- a/src/plugins/built-in/globalSearch/src/indexing/jobs.ts +++ b/src/plugins/built-in/globalSearch/src/indexing/jobs.ts @@ -1,10 +1,10 @@ import type { Job } from "./types"; import { messagesJob } from "./jobs/messages"; -import { assessmentsJob } from "./jobs/assessments"; +import { notificationsJob } from "./jobs/notifications"; import { forumsJob } from "./jobs/forums"; export const jobs: Record = { messages: messagesJob, - assessments: assessmentsJob, + notifications: notificationsJob, forums: forumsJob, }; diff --git a/src/plugins/built-in/globalSearch/src/indexing/jobs/assessments.ts b/src/plugins/built-in/globalSearch/src/indexing/jobs/notifications.ts similarity index 93% rename from src/plugins/built-in/globalSearch/src/indexing/jobs/assessments.ts rename to src/plugins/built-in/globalSearch/src/indexing/jobs/notifications.ts index 654d1f3c..62492a96 100644 --- a/src/plugins/built-in/globalSearch/src/indexing/jobs/assessments.ts +++ b/src/plugins/built-in/globalSearch/src/indexing/jobs/notifications.ts @@ -27,8 +27,7 @@ interface AssessmentNotification { type Notification = MessageNotification | AssessmentNotification; -/* ------------- Progress model ------------- */ -interface AssessmentsProgress { +interface NotificationsProgress { lastTs: number; // ms since epoch of last processed notification } @@ -108,14 +107,14 @@ const fetchAssessmentName = async ( }; /* ------------- Job ------------- */ -export const assessmentsJob: Job = { - id: "assessments", - label: "Assessments", - renderComponentId: "assessment", +export const notificationsJob: Job = { + id: "notifications", + label: "Notifications", + renderComponentId: "notifications", frequency: { type: "expiry", afterMs: 15 * 60 * 1000 }, run: async (ctx) => { - const progress = (await ctx.getProgress()) ?? { + const progress = (await ctx.getProgress()) ?? { lastTs: 0, }; @@ -123,14 +122,14 @@ export const assessmentsJob: Job = { try { notifications = await fetchNotifications(); } catch (e) { - console.error("[Assessments job] fetch failed:", e); + console.error("[Notifications job] fetch failed:", e); return []; } const notificationIsIndexed = async (id: string): Promise => { const [inAssessments, inMessages] = await Promise.all([ ctx - .getStoredItems("assessments") + .getStoredItems("notifications") .then((items) => items.some((i) => i.id === id)), ctx .getStoredItems("messages")