Skip to content

Commit

Permalink
feat: Restore from mnemonic in 2.0 (#7955)
Browse files Browse the repository at this point in the history
* refactor(2.0): Dynamic password

* refactor(2.0): Remove Profile Manager (wip)

* clean up and fix

* clean up

* clean up more code

* clean up

* adapt and remove for profile-manager related code

* clean up more code

* fmt

* more cleanup

* more cleanup

* small tweaks

* more cleanup

* format

* update

* clean up

* https://api.testnet.shimmer.network

* revert Wallet.svelte

* clean up

* remove account debris

* feat: Profile-centric file scheme for wallets

* chore: Clean up 2.0 comments

* more

* more

* more

* works

* clean up

* clean up

* clean up

* chore: Simplify path management

* fmt

* chore: Adapt to sdk changes

* fmt

* clean up

* feat: Restore from mnemonic

* enable features

---------

Co-authored-by: Begoña Álvarez de la Cruz <[email protected]>
  • Loading branch information
marc2332 and begonaalvarezd authored Feb 6, 2024
1 parent 8eddcb0 commit 31546c6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions packages/desktop/features/onboarding.features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ const onboardingFeaturesForTestnet: IOnboardingFeaturesForNetwork = {
},
},
restoreProfile: {
enabled: false,
enabled: true,
recoveryPhrase: {
enabled: false,
enabled: true,
},
strongholdBackup: {
enabled: false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<script lang="ts">
import { OnboardingLayout } from '@components'
import {
RestoreProfileType,
initialiseOnboardingProfile,
onboardingProfile,
updateOnboardingProfile,
} from '@contexts/onboarding'
import { RestoreProfileType, onboardingProfile, updateOnboardingProfile } from '@contexts/onboarding'
import { localize } from '@core/i18n'
import { getNetworkNameFromNetworkId } from '@core/network'
import { ProfileType, clearProfileFromMemory, removeProfileFolder } from '@core/profile'
import {
DirectoryManager,
ProfileType,
clearProfileFromMemory,
getSecretManagerFromProfileType,
removeProfileFolder,
} from '@core/profile'
import features from '@features/features'
import { Animation, OnboardingButton, Text } from '@ui'
import { onMount } from 'svelte'
Expand All @@ -29,8 +30,9 @@
async function onProfileTypeClick(restoreProfileType: RestoreProfileType): Promise<void> {
isBusy = { ...isBusy, [restoreProfileType]: true }
const type = restoreProfileType === RestoreProfileType.Ledger ? ProfileType.Ledger : ProfileType.Software
updateOnboardingProfile({ type, restoreProfileType })
await initialiseOnboardingProfile()
const secretManagerPath = await DirectoryManager.forSecretManager($onboardingProfile.id)
const secretManagerOptions = getSecretManagerFromProfileType(type, secretManagerPath)
updateOnboardingProfile({ restoreProfileType, type, secretManagerOptions })
$restoreProfileRouter.next()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { isOnboardingLedgerProfile, onboardingProfile, onboardingProfileSecretMa
*/
export async function initialiseOnboardingProfile(
isDeveloperProfile = false,
destroyPreviousSecretManager = false
destroyPreviousSecretManager = true
): Promise<void> {
if (get(onboardingProfileSecretManager)) {
if (destroyPreviousSecretManager) {
Expand Down

0 comments on commit 31546c6

Please sign in to comment.