From 1bd890391d3eb755845dd9e5dfbcdfb7d6cb484f Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Sat, 25 Feb 2023 16:43:17 +0700 Subject: [PATCH] added notify on launch --- src/pages/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 3936f6b2..49db3ffb 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -7,7 +7,7 @@ import { follows } from '@stores/follows'; import LumeSymbol from '@assets/icons/Lume'; -import { isPermissionGranted, requestPermission } from '@tauri-apps/api/notification'; +import { isPermissionGranted, requestPermission, sendNotification } from '@tauri-apps/api/notification'; import { motion } from 'framer-motion'; import { useRouter } from 'next/router'; import { JSXElementConstructor, ReactElement, ReactFragment, ReactPortal, useCallback, useEffect, useState } from 'react'; @@ -44,6 +44,9 @@ export default function Page() { const permission = await requestPermission(); permissionGranted = permission === 'granted'; } + if (permissionGranted) { + sendNotification({ title: 'Lume', body: 'Nostr is awesome' }); + } }, []); const getAccount = useCallback(async () => {