From 5789fc636bb1b283dfce481692ad6391352eef6f Mon Sep 17 00:00:00 2001 From: Bas van den Aakster Date: Fri, 12 Dec 2025 12:05:45 +0100 Subject: [PATCH] fix: Create Rondevu instance in handleClaimUsername for new users The previous change broke the claim flow for new users because handleClaimUsername expected rondevu to exist, but we stopped creating it during initialization for new users. Now handleClaimUsername creates the Rondevu instance itself. --- src/App.jsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 9c68435..d9f7842 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -328,18 +328,19 @@ export default function App() { // Claim username const handleClaimUsername = async () => { - if (!rondevu || !usernameInput) return; + if (!usernameInput) return; try { - const keypair = rondevu.getKeypair(); + // Create new Rondevu instance (will generate keypair if needed) const newService = new Rondevu({ apiUrl: API_URL, username: usernameInput, - keypair, + keypair: rondevu?.getKeypair(), // Use existing keypair if available, otherwise will generate new one }); await newService.initialize(); await newService.claimUsername(); + const keypair = newService.getKeypair(); setRondevu(newService); setMyUsername(usernameInput); localStorage.setItem('rondevu-username', usernameInput);