File tree Expand file tree Collapse file tree 2 files changed +6
-9
lines changed
Expand file tree Collapse file tree 2 files changed +6
-9
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 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