Fix custom to pre URL swaps (#2358)

This commit is contained in:
Jaco Greeff 2020-03-09 16:22:17 +01:00 committed by GitHub
parent 37fad4ca99
commit 3f4b260d18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -5,6 +5,7 @@
import { AppProps as Props } from '@polkadot/react-components/types';
import React, { useEffect, useState } from 'react';
import { Trans } from 'react-i18next';
import store from 'store';
import styled from 'styled-components';
import { registry } from '@polkadot/react-api';
@ -138,9 +139,13 @@ function Developer ({ className, onStatusChange }: Props): React.ReactElement<Pr
/>
</div>
</div>
<div className='ui--row'>
<div className='full'>
<Trans i18nKey='devConfig'><div className='help'>If you are a development team with at least a test network available, consider adding the types directly <a href='https://github.com/polkadot-js/apps/tree/master/packages/apps-config' rel='noopener noreferrer' target='_blank'>to the apps-config</a>, allowing out of the box operation for your spec &amp; chains, both for you and anybody trying to connect to it. This is not a replacement for your chain-specific UI, however doing so does help in allowing users to easily discover and use with zero-config.</div></Trans>
</div>
</div>
<Button.Group>
<Button
isDisabled={typesHasNoEntries}
isNegative
onClick={_clearTypes}
label={t('Reset')}
@ -165,4 +170,8 @@ export default styled(Developer)`
margin-left: 2rem;
position: relative;
}
.help {
padding: 0.5rem 2rem;
}
`;

View File

@ -79,7 +79,7 @@ function SelectUrl ({ className, onChange }: Props): React.ReactElement<Props> {
...makeUrl(
isCustom
? info.url
: availableEndpoints[0].value as string
: (availableEndpoints.find(({ value }) => !!value) || { value: 'ws://127.0.0.1:9944' }).value as string
),
isCustom
});