Adjust democracy display detection (#8383)
This commit is contained in:
parent
e47f486671
commit
27964a4101
@ -25,7 +25,7 @@ export default function create (t: TFunction): Route {
|
||||
Component,
|
||||
display: {
|
||||
needsApi: [
|
||||
'tx.democracy.notePreimage'
|
||||
'tx.democracy.propose'
|
||||
],
|
||||
needsApiCheck
|
||||
},
|
||||
|
||||
@ -7,7 +7,7 @@ import type { HexString } from '@polkadot/util/types';
|
||||
import React from 'react';
|
||||
|
||||
import { Button } from '@polkadot/react-components';
|
||||
import { useToggle } from '@polkadot/react-hooks';
|
||||
import { useApi, useToggle } from '@polkadot/react-hooks';
|
||||
|
||||
import { useTranslation } from '../translate';
|
||||
import PreImage from './PreImage';
|
||||
@ -19,12 +19,14 @@ interface Props {
|
||||
|
||||
function PreImageButton ({ imageHash, isImminent }: Props): React.ReactElement<Props> | null {
|
||||
const { t } = useTranslation();
|
||||
const { api } = useApi();
|
||||
const [isPreimageOpen, togglePreimage] = useToggle();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Button
|
||||
icon='plus'
|
||||
isDisabled={!api.tx.democracy.notePreimage}
|
||||
label={t<string>('Image')}
|
||||
onClick={togglePreimage}
|
||||
/>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user