File tree Expand file tree Collapse file tree 4 files changed +7
-17
lines changed
Expand file tree Collapse file tree 4 files changed +7
-17
lines changed Original file line number Diff line number Diff line change @@ -5,9 +5,7 @@ import { StyleProp, ViewStyle } from 'react-native';
55import WalletOnboarding from '../../components/WalletOnboarding' ;
66import { useAppDispatch } from '../../hooks/redux' ;
77import { updateSettings } from '../../store/slices/settings' ;
8- import { saveWidget } from '../../store/slices/widgets' ;
98import { Display } from '../../styles/text' ;
10- import { getDefaultOptions } from '../../utils/widgets' ;
119
1210const MainOnboarding = ( {
1311 style,
@@ -16,14 +14,8 @@ const MainOnboarding = ({
1614} ) : ReactElement => {
1715 const dispatch = useAppDispatch ( ) ;
1816 const { t } = useTranslation ( 'onboarding' ) ;
19- const priceOptions = getDefaultOptions ( 'price' ) ;
20- const newsOptions = getDefaultOptions ( 'news' ) ;
21- const blocksOptions = getDefaultOptions ( 'blocks' ) ;
2217
2318 const onHideOnboarding = ( ) : void => {
24- dispatch ( saveWidget ( { id : 'price' , options : priceOptions } ) ) ;
25- dispatch ( saveWidget ( { id : 'news' , options : newsOptions } ) ) ;
26- dispatch ( saveWidget ( { id : 'blocks' , options : blocksOptions } ) ) ;
2719 dispatch ( updateSettings ( { hideOnboardingMessage : true } ) ) ;
2820 } ;
2921
Original file line number Diff line number Diff line change @@ -26,7 +26,6 @@ import {
2626 ignoresHideBalanceToastSelector ,
2727 scanAllAddressesTimestampSelector ,
2828} from '../../store/reselect/user' ;
29- import { hasWidgetsSelector } from '../../store/reselect/widgets' ;
3029import { updateSettings } from '../../store/slices/settings' ;
3130import { ignoreHideBalanceToast , updateUser } from '../../store/slices/user' ;
3231import { View as ThemedView } from '../../styles/components' ;
@@ -57,7 +56,6 @@ const Wallets = ({ onFocus }: Props): ReactElement => {
5756 scanAllAddressesTimestampSelector ,
5857 ) ;
5958 const hideOnboardingSetting = useAppSelector ( hideOnboardingMessageSelector ) ;
60- const hasWidgets = useAppSelector ( hasWidgetsSelector ) ;
6159 const showWidgets = useAppSelector ( showWidgetsSelector ) ;
6260 const insets = useSafeAreaInsets ( ) ;
6361 const { t } = useTranslation ( 'wallet' ) ;
@@ -94,8 +92,7 @@ const Wallets = ({ onFocus }: Props): ReactElement => {
9492 setRefreshing ( false ) ;
9593 } ;
9694
97- const hideOnboarding =
98- hideOnboardingSetting || totalBalance > 0 || hasWidgets ;
95+ const hideOnboarding = hideOnboardingSetting || totalBalance > 0 ;
9996
10097 return (
10198 < ThemedView style = { styles . root } >
Original file line number Diff line number Diff line change @@ -23,10 +23,6 @@ export const widgetsOrderSelector = createSelector(
2323 ( widgets ) => widgets . sortOrder ,
2424) ;
2525
26- export const hasWidgetsSelector = ( state : RootState ) : boolean => {
27- return Object . keys ( state . widgets . widgets ) . length > 0 ;
28- } ;
29-
3026export const onboardedWidgetsSelector = ( state : RootState ) : boolean => {
3127 return state . widgets . onboardedWidgets ;
3228} ;
Original file line number Diff line number Diff line change 11import { PayloadAction , createSlice } from '@reduxjs/toolkit' ;
2+ import { getDefaultOptions } from '../../utils/widgets' ;
23import { TWidgets } from '../types/widgets' ;
34
45export type TWidgetsState = {
@@ -8,7 +9,11 @@ export type TWidgetsState = {
89} ;
910
1011export const initialWidgetsState : TWidgetsState = {
11- widgets : { } ,
12+ widgets : {
13+ price : getDefaultOptions ( 'price' ) ,
14+ news : getDefaultOptions ( 'news' ) ,
15+ blocks : getDefaultOptions ( 'blocks' ) ,
16+ } ,
1217 onboardedWidgets : false ,
1318 sortOrder : [ ] ,
1419} ;
You can’t perform that action at this time.
0 commit comments