Fix validate missing selected storage profile.#132
Fix validate missing selected storage profile.#132chenkins wants to merge 2 commits intofeature/cipherduck-uvffrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adjusts the Create Vault wizard’s “EnterVaultDetails” rendering logic so the UI correctly reacts to the presence/absence of available storage profiles (and regions), addressing the missing validation flow described in issue #123 / PR #125.
Changes:
- Replace incorrect
backends?.values?.length/regions?.values?.lengthchecks with arraylengthchecks in the template. - Initialize
backendsandregionsrefs as empty arrays instead ofnull/undefined. - Update the “no storage profile available” branch condition to use the new array-based checks.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| </div> | ||
| <!-- // / start katta modification --> | ||
| <div v-else-if="state == State.EnterVaultDetails && ((backends?.values?.length ?? 0) == 0 || (regions?.values?.length ?? 0) == 0)"> | ||
| <div v-else-if="state == State.EnterVaultDetails && (backends.length == 0 || regions.length == 0)"> |
There was a problem hiding this comment.
backends/regions now default to empty arrays, but state transitions to EnterVaultDetails before the async storage-profile fetch finishes. That makes this branch render the “no storage profile available” error during normal loading (and also if the fetch fails). Consider keeping the UI in a loading state until storage profiles/regions are loaded (e.g., a storageProfilesLoaded/storageProfilesError flag, or delaying state = EnterVaultDetails until after backend.storageprofiles.get(false) completes), and only show this error when loading finished and the resulting list is actually empty.
ae45e69 to
e672b9e
Compare
Closes #123
Fixes condition in #125 .