fix(1658): enabled preferences (#498)

keep-around/af30b88d367751c9e05a735e4a0467a96238ef47
Mirlan 4 years ago committed by GitHub
parent 3cf3b329e4
commit be0ea9ba42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      src/features/PreferencesPopup/store/hooks/index.tsx

@ -14,19 +14,18 @@ import { useSearch } from './useSearch'
export const usePreferences = () => {
const [firstLoad, setFirstLoad] = useLocalStore({
// defaultValue: true,
defaultValue: false,
defaultValue: true,
key: 'preferences_first_load',
validator: isBoolean,
})
const {
close,
isOpen,
// open,
open,
} = useToggle()
const {
// fetchInitialSports,
fetchInitialSports,
onSportSelect,
selectedSports,
setInitialSelectedSports,
@ -55,7 +54,7 @@ export const usePreferences = () => {
} = useSelectedTournaments(selectedSports, tournaments)
const {
// fetchInitialPreferences,
fetchInitialPreferences,
isApplyButtonDisabled,
isFetching: isFetchingPrefernces,
isSaving,
@ -79,10 +78,10 @@ export const usePreferences = () => {
])
const openPopup = useCallback(() => {
// fetchInitialPreferences()
// fetchInitialSports()
// open()
}, [/* fetchInitialPreferences, fetchInitialSports, open */])
fetchInitialPreferences()
fetchInitialSports()
open()
}, [fetchInitialPreferences, fetchInitialSports, open])
const closePopup = () => {
reset()

Loading…
Cancel
Save