Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
leoniefritsch committed Sep 10, 2024
1 parent 817758d commit 7cb15e5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
7 changes: 3 additions & 4 deletions frontend/src/components/PresentationRequest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default {
default: 'verify'
},
composeTypesWithOr: {
type: Boolean,
type: Boolean,
default: false
}
},
Expand Down Expand Up @@ -117,14 +117,13 @@ export default {
definition.input_descriptors.push(
getInputDescriptor(this.credentialTypes.join("|"))
);
}
if (!this.composeTypesWithOr) {
} else {
for (const credentialType of this.credentialTypes) {
definition.input_descriptors.push(
getInputDescriptor(credentialType)
);
}
}
}
return definition;
},
Expand Down
18 changes: 9 additions & 9 deletions frontend/src/views/PresentationRequest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,20 @@
<div class="row mx-md-3" v-if="customCredentialTypes.length >= 2">
<div class="col-6 mt-2">
<div class="form-check form-switch">
<input v-model="composeTypesWithOr" class="form-check-input" type="checkbox" id="composeTypesWithOrSwitch">
<input v-model="composeTypesWithOr" class="form-check-input" type="checkbox"
id="composeTypesWithOrSwitch">
<label class="form-check-label" for="composeTypesWithOrSwitch">
<small>any credential is sufficient</small>
</label>
</div>
</div>
</div>
</div>
<div v-if="selectedCredential === 'custom'">
<PresentationRequest :credentialTypes="customCredentialTypes" :composeTypesWithOr="composeTypesWithOr"/>
</div>
<div v-if="selectedCredential === 'any'">
<PresentationRequest :credentialTypes="['']" :composeTypesWithOr="false"/>
</div>
</div>

<PresentationRequest :credentialTypes="selectedCredential === 'custom' ? customCredentialTypes : ['']"
:composeTypesWithOr="selectedCredential === 'custom' ? composeTypesWithOr : false" />


</div>
</div>
</template>
Expand All @@ -81,6 +81,6 @@ export default {
},
components: {
PresentationRequest
},
},
}
</script>

0 comments on commit 7cb15e5

Please sign in to comment.