File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -174,18 +174,22 @@ class TodoApp extends Component {
174174 /* -------------------- STORAGE PROVIDER CONFIGURATION -------------------- */
175175 // Get configured storage provider with enhanced DID-based discovery
176176 getStorageProvider ( ) {
177- // First check if we have URIs from TypeRegistrations or query params
178- let availableUris = [ ... this . state . availableUris ]
179-
180- // If no TypeRegistration URIs, check query string
181- if ( availableUris . length === 0 ) {
182- const queryUris = this . parseUrisFromQueryString ( )
177+ // First check query string (takes priority over TypeRegistrations)
178+ const queryUris = this . parseUrisFromQueryString ( )
179+ let availableUris = [ ]
180+
181+ if ( queryUris . length > 0 ) {
182+ // Query string URIs take priority
183183 availableUris = queryUris
184-
184+
185185 // Store the available URIs in state for later use
186- if ( queryUris . length > 0 && this . state . availableUris . length === 0 ) {
186+ if ( this . state . availableUris . length === 0 ||
187+ JSON . stringify ( this . state . availableUris ) !== JSON . stringify ( queryUris ) ) {
187188 this . setState ( { availableUris : queryUris } )
188189 }
190+ } else {
191+ // Fall back to TypeRegistrations if no query URIs
192+ availableUris = [ ...this . state . availableUris ]
189193 }
190194
191195 // Get the current URI (either the selected one or the first one)
You can’t perform that action at this time.
0 commit comments