|
3 | 3 | import { OnboardingLayout } from '@components'
|
4 | 4 | import { handleError } from '@core/error/handlers'
|
5 | 5 | import { localize } from '@core/i18n'
|
6 |
| - import { MAX_STRONGHOLD_PASSWORD_LENGTH, unlockStronghold } from '@core/profile' |
7 |
| - import { activeProfile, updateActiveProfile } from '@core/profile/stores' |
| 6 | + import { MAX_STRONGHOLD_PASSWORD_LENGTH, changePasswordAndUnlockStronghold, unlockStronghold } from '@core/profile' |
8 | 7 | import { PASSWORD_REASON_MAP } from '@core/stronghold'
|
9 | 8 | import { Animation, Button, PasswordInput, Text, TextHint } from '@ui'
|
10 | 9 | import { HTMLButtonType, TextType } from '@ui/enums'
|
11 |
| - import { onMount } from 'svelte' |
12 | 10 | import zxcvbn from 'zxcvbn'
|
13 | 11 | import { updateStrongholdRouter } from '../update-stronghold-router'
|
14 | 12 | import { TextHintVariant } from 'shared/components/enums'
|
15 | 13 | import { AnimationEnum } from '@auxiliary/animation'
|
16 | 14 | import { onboardingProfile, updateOnboardingProfile } from '@contexts/onboarding'
|
17 |
| - import { changeStrongholdPassword } from '@core/secret-manager' |
18 | 15 |
|
19 | 16 | export let oldPassword: string
|
20 | 17 | export let newPassword: string
|
21 |
| - export let isRecovery: boolean |
22 | 18 |
|
23 | 19 | let passwordError: string = ''
|
24 | 20 | let confirmPassword: string = ''
|
|
63 | 59 | if (isPasswordValid) {
|
64 | 60 | try {
|
65 | 61 | isSubmitBusy = true
|
66 |
| - await changeStrongholdPassword(oldPassword, newPassword) |
| 62 | + await changePasswordAndUnlockStronghold(oldPassword, newPassword) |
67 | 63 | if ($onboardingProfile) {
|
68 | 64 | updateOnboardingProfile({ strongholdPassword: newPassword })
|
69 | 65 | }
|
|
95 | 91 | isSkipBusy = false
|
96 | 92 | }
|
97 | 93 | }
|
98 |
| -
|
99 |
| - onMount(async () => { |
100 |
| - // TODO(2.0) Profile manager is gone |
101 |
| - if (!isRecovery && !$profileManager) { |
102 |
| - const profileManagerOptions = await buildProfileManagerOptionsFromProfileData($activeProfile) |
103 |
| - const { storagePath, coinType, clientOptions, secretManager } = profileManagerOptions |
104 |
| - updateActiveProfile({ clientOptions }) |
105 |
| - // TODO(2.0): Update initialiseProfileManager to new logic |
106 |
| - const manager = await initialiseProfileManager( |
107 |
| - $activeProfile?.id, |
108 |
| - storagePath, |
109 |
| - coinType, |
110 |
| - clientOptions, |
111 |
| - secretManager |
112 |
| - ) |
113 |
| - profileManager.set(manager) |
114 |
| - } |
115 |
| - }) |
116 | 94 | </script>
|
117 | 95 |
|
118 | 96 | <OnboardingLayout allowBack={false}>
|
|
0 commit comments