fix: Fixes #1986 proposals of undefined (#1987)

* fix: Fixes #1986 proposals of undefined

* fix: Prevent undefined proposals in packages/app-council/src/useCounter.ts

Co-Authored-By: Jaco Greeff <jacogr@gmail.com>

* fix: Revert change since api.derive.democracy is always defined
This commit is contained in:
Luke Schoen 2019-12-03 11:52:24 +01:00 committed by Jaco Greeff
parent 721f1dd2d2
commit d94241f624
2 changed files with 2 additions and 2 deletions

View File

@ -9,7 +9,7 @@ import { useApi, trackStream } from '@polkadot/react-hooks';
export default function useCounter (): number {
const { api, isApiReady } = useApi();
const motions = trackStream<Hash[]>(isApiReady ? api.query.council.proposals : undefined, []);
const motions = trackStream<Hash[]>(isApiReady ? api.query.council?.proposals : undefined, []);
const [counter, setCounter] = useState(0);
useEffect((): void => {

View File

@ -9,7 +9,7 @@ import { useApi, trackStream } from '@polkadot/react-hooks';
export default function useCounter (): number {
const { api, isApiReady } = useApi();
const proposals = trackStream<Hash[]>(isApiReady ? api.query.technicalCommittee.proposals : undefined, []);
const proposals = trackStream<Hash[]>(isApiReady ? api.query.technicalCommittee && api.query.technicalCommittee.proposals : undefined, []);
const [counter, setCounter] = useState(0);
useEffect((): void => {