Skip to content

Commit

Permalink
feat: remove delegation name for offchain spaces (#923)
Browse files Browse the repository at this point in the history
* feat: remove delegation name for offchain spaces

* fix: fill in name for offchain governor-subgraph delegation
  • Loading branch information
Sekhmet authored Oct 23, 2024
1 parent b13c0f3 commit 0997e54
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions apps/ui/src/components/Modal/DelegationConfig.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,17 @@ const definition = computed(() => {
additionalProperties: true,
required: ['name', 'apiType', 'apiUrl'],
properties: {
name: {
type: 'string',
title: 'Name',
minLength: 1,
maxLength: 32,
examples: ['Delegation API name']
},
...(!offchainNetworks.includes(props.networkId)
? {
name: {
type: 'string',
title: 'Name',
minLength: 1,
maxLength: 32,
examples: ['Delegation API name']
}
}
: {}),
apiType: {
type: ['string', 'null'],
enum: [null, 'governor-subgraph'],
Expand Down Expand Up @@ -102,7 +106,12 @@ const formValid = computed(() => {
});
async function handleSubmit() {
emit('add', form.value);
const config = clone(form.value);
if (offchainNetworks.includes(props.networkId)) {
config.name = 'ERC-20 Votes';
}
emit('add', config);
emit('close');
}
Expand Down

0 comments on commit 0997e54

Please sign in to comment.