feat: integrate UserPreferencesContext for improved preference management

- Added `UserPreferencesProvider` to `RootLayout` for centralized user preferences handling.
- Updated components to remove direct user preferences fetching, relying on context instead.
- Enhanced SSR data fetching by consolidating user preferences retrieval into a single service call.
- Cleaned up unused props in various components to streamline the codebase.
This commit is contained in:
Julien Froidefond
2025-09-21 15:03:19 +02:00
parent 4ba6ba2c0b
commit c650c67627
17 changed files with 86 additions and 138 deletions

View File

@@ -1,4 +1,3 @@
import { userPreferencesService } from '@/services/user-preferences';
import { tasksService } from '@/services/tasks';
import { tagsService } from '@/services/tags';
import { backupService } from '@/services/backup';
@@ -10,8 +9,7 @@ export const dynamic = 'force-dynamic';
export default async function AdvancedSettingsPage() {
// Fetch all data server-side
const [preferences, taskStats, tags] = await Promise.all([
userPreferencesService.getAllPreferences(),
const [taskStats, tags] = await Promise.all([
tasksService.getTaskStats(),
tagsService.getTags()
]);
@@ -38,7 +36,6 @@ export default async function AdvancedSettingsPage() {
return (
<AdvancedSettingsPageClient
initialPreferences={preferences}
initialDbStats={dbStats}
initialBackupData={backupData}
/>