Most Idle games use the following flow for save codes:
// Step 5: Update UI & Save to LocalStorage updateUI(); saveToLocal(); // Persist the imported data idle dice import save codes work