loader
This commit is contained in:
parent
56bafd22b9
commit
4965eb25d1
25
src/App.tsx
25
src/App.tsx
@ -43,6 +43,7 @@ export function App() {
|
||||
setProducts(data.cart.flat().map(product => normalizeProductImage(product)));
|
||||
setInitial(false, data.excess || 0, data.precision || 0);
|
||||
setIsCartComplete(false)
|
||||
}).finally(() => {
|
||||
setShowLoader(false);
|
||||
});
|
||||
};
|
||||
@ -65,26 +66,34 @@ export function App() {
|
||||
|
||||
const handleDaysChange = useCallback(async (nextDays: number) => {
|
||||
setShowLoader(true);
|
||||
await setOption('days', nextDays);
|
||||
loadInitialState();
|
||||
setOption('days', nextDays)
|
||||
.finally(() => {
|
||||
loadInitialState();
|
||||
});
|
||||
}, [loadInitialState]);
|
||||
|
||||
const handleUsersChange = useCallback(async (nextUsers: User[]) => {
|
||||
setShowLoader(true);
|
||||
await setOption('users', nextUsers);
|
||||
loadInitialState();
|
||||
setOption('users', nextUsers)
|
||||
.finally(() => {
|
||||
loadInitialState();
|
||||
});
|
||||
}, [loadInitialState]);
|
||||
|
||||
const handleCategoriesChange = useCallback(async (nextCategories: string[]) => {
|
||||
setShowLoader(true);
|
||||
await setOption('initial_groups', nextCategories);
|
||||
loadInitialState();
|
||||
setOption('initial_groups', nextCategories)
|
||||
.finally(() => {
|
||||
loadInitialState();
|
||||
});
|
||||
}, [loadInitialState]);
|
||||
|
||||
const handlePercentChange = useCallback(async (fullness: number) => {
|
||||
setShowLoader(true);
|
||||
await setOption('fullness', fullness);
|
||||
loadInitialState();
|
||||
setOption('fullness', fullness)
|
||||
.finally(() => {
|
||||
loadInitialState();
|
||||
})
|
||||
}, [loadInitialState]);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user