Refactor chore management to use React Query hooks for timer and chore actions
- Replaced direct API calls with React Query hooks in ChoreView, ChoreCard, CompactChoreCard, and TimerDetails components for better state management and error handling. - Updated ArchivedTasks to utilize useUnArchiveChore hook for restoring archived chores. - Enhanced NotificationSetting to include device registration logic and improved user feedback for push notifications. - Refactored TimerEditModal and TimerDetails to streamline timer session updates and deletions using hooks. - Improved ChoreActionMenu to handle archiving and unarchiving chores with hooks. - Adjusted various components to use getSafeBottomStyles for consistent bottom padding. - Cleaned up unused imports and optimized loading states across components.
This commit is contained in:
@@ -6,7 +6,7 @@ import SSEProvider from './SSEContext'
|
||||
import ThemeContext from './ThemeContext'
|
||||
import WebSocketProvider from './WebSocketContext'
|
||||
|
||||
const Contexts = () => {
|
||||
const Contexts = ({ children }) => {
|
||||
const contexts = [
|
||||
AlertsProvider,
|
||||
ThemeContext,
|
||||
@@ -19,7 +19,7 @@ const Contexts = () => {
|
||||
|
||||
return contexts.reduceRight((acc, Context) => {
|
||||
return <Context>{acc}</Context>
|
||||
}, {})
|
||||
}, children)
|
||||
}
|
||||
|
||||
export default Contexts
|
||||
|
||||
@@ -4,10 +4,10 @@ const QueryContext = ({ children }) => {
|
||||
const queryClient = new QueryClient({
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
staleTime: 60000, // 60 seconds
|
||||
gcTime: 300000, // 5 minutes
|
||||
staleTime: 300000, // 5 minutes
|
||||
gcTime: 600000, // 10 minutes
|
||||
refetchOnWindowFocus: false,
|
||||
retry: 0,
|
||||
retry: 1,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user