diff --git a/.gitignore b/.gitignore
index 7ef3ed6..cedf811 100644
--- a/.gitignore
+++ b/.gitignore
@@ -43,3 +43,4 @@ next-env.d.ts
# customize
data/*
Budfile
+certificates
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 765a86f..ced7bd2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,17 @@
# Changelog
+## Version 0.1.19
+
+### Added
+
+- PWA support to allow installing app to mobile (#39)
+- right click context menu for habits
+- Pomodoro clock
+
+### Fixed
+
+- disable today's earned SSR (#38)
+
## Version 0.1.18
### Added
diff --git a/app/actions/push.ts b/app/actions/push.ts
new file mode 100644
index 0000000..3eafff3
--- /dev/null
+++ b/app/actions/push.ts
@@ -0,0 +1,49 @@
+'use server'
+
+import webpush from 'web-push'
+
+webpush.setVapidDetails(
+ 'mailto:mydohsimpson@gmail.com',
+ process.env.NEXT_PUBLIC_VAPID_PUBLIC_KEY!,
+ process.env.VAPID_PRIVATE_KEY!
+)
+
+interface PushSubscriptionWithKeys extends PushSubscription {
+ keys: {
+ p256dh: string
+ auth: string
+ }
+}
+
+let subscription: PushSubscriptionWithKeys | null = null
+
+export async function subscribeUser(sub: PushSubscriptionWithKeys) {
+ subscription = sub
+ return { success: true }
+}
+
+export async function unsubscribeUser() {
+ subscription = null
+ return { success: true }
+}
+
+export async function sendNotification(message: string) {
+ if (!subscription) {
+ throw new Error('No subscription available')
+ }
+
+ try {
+ await webpush.sendNotification(
+ subscription,
+ JSON.stringify({
+ title: 'HabitTrove',
+ body: message,
+ icon: '/icon.png',
+ })
+ )
+ return { success: true }
+ } catch (error) {
+ console.error('Error sending push notification:', error)
+ return { success: false, error: 'Failed to send notification' }
+ }
+}
diff --git a/app/calendar/page.tsx b/app/calendar/page.tsx
index f2b0c21..2b94ace 100644
--- a/app/calendar/page.tsx
+++ b/app/calendar/page.tsx
@@ -3,9 +3,7 @@ import HabitCalendar from '@/components/HabitCalendar'
export default function CalendarPage() {
return (
-