Kantongku: notifikasi pengingat catat harian (toggle + pilih jam)

This commit is contained in:
Bro
2026-08-16 16:34:38 +07:00
parent 8ea2475c71
commit 0b269621b2
5 changed files with 216 additions and 16 deletions
+10
View File
@@ -5,6 +5,7 @@ import { SafeAreaProvider } from 'react-native-safe-area-context';
import { NavigationContainer } from '@react-navigation/native';
import { initDatabase } from './src/db/database';
import { checkRecurringDue, getSetting } from './src/db/repositories';
import { scheduleDailyReminder } from './src/utils/notifications';
import { RootNavigator } from './src/navigation';
import { colors } from './src/theme/colors';
@@ -27,6 +28,15 @@ export default function App() {
const onboarded = await getSetting('onboarded');
const userName = await getSetting('user_name');
setInitialRoute(onboarded === '1' && userName ? 'Main' : 'Onboarding');
// Reschedule pengingat harian kalau aktif
try {
if ((await getSetting('reminder_enabled')) === '1') {
const h = Number(await getSetting('reminder_hour'));
await scheduleDailyReminder(Number.isFinite(h) ? h : 20, 0);
}
} catch {
// abaikan
}
setReady(true);
SplashScreen.hideAsync().catch(() => {});
})