added windows notifications and have avatar health/energy update with task completion

This commit is contained in:
masongga
2026-05-24 00:11:23 -06:00
parent 25fb5499c1
commit dfafba0c94
12 changed files with 842 additions and 33 deletions

View File

@@ -0,0 +1,31 @@
import { hasCompletedDailyQuizToday } from "@/lib/daily-quiz-storage";
import { getDailyTasks } from "@/lib/daily-tasks";
import { getTodayDateKey, isHabitCompletedToday } from "@/lib/habits-storage";
export type DailyReminderStatus = {
dateKey: string;
quizCompleted: boolean;
totalTasks: number;
incompleteTaskCount: number;
needsReminder: boolean;
};
export async function getDailyReminderStatus(): Promise<DailyReminderStatus> {
const dateKey = getTodayDateKey();
const [quizCompleted, tasks] = await Promise.all([
hasCompletedDailyQuizToday(),
getDailyTasks(),
]);
const incompleteTaskCount = tasks.filter(
(task) => !isHabitCompletedToday(task, dateKey),
).length;
return {
dateKey,
quizCompleted,
totalTasks: tasks.length,
incompleteTaskCount,
needsReminder: !quizCompleted || incompleteTaskCount > 0,
};
}