* 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:
parent
721f1dd2d2
commit
d94241f624
@ -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 => {
|
||||
|
||||
@ -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 => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user