Implement onboarding reset functionality and enhance backup features
- Added a new method to reset the onboarding state, allowing users to re-initiate the onboarding process. - Integrated backup creation functionality, enabling users to create encrypted backups of their node identity. - Updated API endpoints to handle onboarding reset and backup creation requests. - Enhanced UI components to support the new onboarding reset and backup features, including error handling and user feedback. - Introduced new dependencies for cryptographic operations and data encoding.
This commit is contained in:
@@ -116,14 +116,22 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Replay Intro - Bottom of Page -->
|
||||
<div class="mt-8 text-center">
|
||||
<!-- Replay Intro / Restart Onboarding - Bottom of Page -->
|
||||
<div class="mt-8 text-center flex items-center justify-center gap-4">
|
||||
<button
|
||||
@click="replayIntro"
|
||||
class="text-xs text-white/50 hover:text-white/70 transition-colors underline-offset-2 hover:underline"
|
||||
>
|
||||
Replay Intro
|
||||
</button>
|
||||
<span class="text-white/30">|</span>
|
||||
<button
|
||||
@click="restartOnboarding"
|
||||
:disabled="isResettingOnboarding"
|
||||
class="text-xs text-white/50 hover:text-white/70 transition-colors underline-offset-2 hover:underline disabled:opacity-50 disabled:cursor-not-allowed"
|
||||
>
|
||||
{{ isResettingOnboarding ? 'Resetting...' : 'Onboarding' }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -286,6 +294,27 @@ function replayIntro() {
|
||||
// Navigate to root to trigger splash screen
|
||||
window.location.href = '/'
|
||||
}
|
||||
|
||||
const isResettingOnboarding = ref(false)
|
||||
|
||||
async function restartOnboarding() {
|
||||
if (isResettingOnboarding.value) return
|
||||
isResettingOnboarding.value = true
|
||||
try {
|
||||
await rpcClient.resetOnboarding()
|
||||
localStorage.removeItem('neode_onboarding_complete')
|
||||
localStorage.removeItem('neode_did')
|
||||
localStorage.removeItem('neode_did_state')
|
||||
localStorage.removeItem('neode_backup_created')
|
||||
await router.push('/onboarding/intro')
|
||||
window.location.reload()
|
||||
} catch (err) {
|
||||
console.error('Failed to reset onboarding:', err)
|
||||
error.value = err instanceof Error ? err.message : 'Failed to reset onboarding'
|
||||
} finally {
|
||||
isResettingOnboarding.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in New Issue
Block a user