1
- import { activeProfile , activeWallets , addWalletPersistedDataToActiveProfile , createWallet , login } from '@core/profile'
1
+ import { IWallet , activeProfile , activeWallets , addWalletPersistedDataToActiveProfile , createWallet , login } from '@core/profile'
2
2
import { get } from 'svelte/store'
3
3
import { OnboardingType } from '../enums'
4
4
import { addWalletPersistedDataToOnboardingProfile , onboardingProfile } from '../stores'
@@ -16,50 +16,35 @@ export async function completeOnboardingProcess(): Promise<void> {
16
16
createNewProfileFromOnboardingProfile ( )
17
17
}
18
18
19
- console . log ( "post createNewProfileFromOnboardingProfile" , get ( activeProfile ) )
20
-
21
19
const onboardingType = get ( onboardingProfile ) ?. onboardingType
22
20
const shouldRecoverAccounts = onboardingType === OnboardingType . Restore || onboardingType === OnboardingType . Claim
23
21
showBalanceOverviewPopup . set ( shouldRecoverAccounts )
24
22
25
- console . log ( "pre createOnboardingWallet -----" )
26
-
27
23
await createOnboardingWallet ( )
28
-
29
- console . log ( "post createOnboardingWallet and pre login" ) ;
30
-
31
-
32
24
void login ( { isFromOnboardingFlow : true , shouldRecoverAccounts } )
33
25
34
26
onboardingProfile . set ( undefined )
35
27
}
36
28
37
- export async function createOnboardingWallet ( name ?: string , color ?: string ) : Promise < IWalletState > {
29
+ export async function createOnboardingWallet ( name ?: string , color ?: string ) : Promise < IWallet > {
38
30
// 1. Get the wallet name
39
31
const walletName = name || `${ localize ( 'general.account' ) } ${ ( get ( activeWallets ) ?. length ?? 0 ) + 1 } ` ;
40
32
41
- console . log ( "walletName" , walletName )
42
-
43
33
// 2. Create the wallet instance
44
34
const wallet = await createWallet ( )
45
35
46
- console . log ( "wallet" , wallet )
47
-
48
36
// 3. Sync the wallet with the Node
49
37
// TODO(2.0): test & fix sync when we have iota2.0 nodes
50
- //await account.sync(DEFAULT_SYNC_OPTIONS)
51
-
38
+ //await wallet.sync(DEFAULT_SYNC_OPTIONS)
52
39
// 4. Create a wrapper over the wallet instance and the persisted data
53
- const [ walletState , accountPersistedData ] = await buildWalletStateAndPersistedData ( wallet , walletName , color )
54
-
55
- console . log ( "walletState" , walletState , accountPersistedData )
40
+ // const [walletState, accountPersistedData] = await buildWalletStateAndPersistedData(wallet, walletName, color)
56
41
57
42
// TODO(2.0) Fix
58
43
// addAccountToActiveAccounts(walletState)
59
- addWalletPersistedDataToOnboardingProfile ( walletState . id , accountPersistedData )
44
+ // addWalletPersistedDataToOnboardingProfile(walletState.id, accountPersistedData)
60
45
// TODO(2.0) Fix
61
46
// addEmptyAccountActivitiesToAllAccountActivities(walletState.id)
62
47
63
48
64
- return walletState
49
+ return wallet
65
50
}
0 commit comments