Settings UI: Add Todos saving and dismissing

This commit is contained in:
Daniel Dudzic 2025-02-03 23:06:33 +01:00
parent 0daf56b2af
commit f6717e2e66
No known key found for this signature in database
GPG key ID: 31B40D33E3465483
16 changed files with 433 additions and 89 deletions

View file

@ -5,6 +5,7 @@ import {
PaymentHooks,
SettingsHooks,
StylingHooks,
TodosHooks,
} from '../data';
export const useSaveSettings = () => {
@ -13,6 +14,7 @@ export const useSaveSettings = () => {
const { persist: persistPayment } = PaymentHooks.useStore();
const { persist: persistSettings } = SettingsHooks.useStore();
const { persist: persistStyling } = StylingHooks.useStore();
const { persist: persistTodos } = TodosHooks.useStore();
const persistAll = useCallback( () => {
withActivity(
@ -30,7 +32,14 @@ export const useSaveSettings = () => {
'Save styling details',
persistStyling
);
}, [ persistPayment, persistSettings, persistStyling, withActivity ] );
withActivity( 'persist-todos', 'Save todos state', persistTodos );
}, [
persistPayment,
persistSettings,
persistStyling,
persistTodos,
withActivity,
] );
return { persistAll };
};