diff --git a/packages/app-council/src/useCounter.ts b/packages/app-council/src/useCounter.ts index 170dd7b1f0f1..73192f6b524e 100644 --- a/packages/app-council/src/useCounter.ts +++ b/packages/app-council/src/useCounter.ts @@ -9,7 +9,7 @@ import { useApi, trackStream } from '@polkadot/react-hooks'; export default function useCounter (): number { const { api, isApiReady } = useApi(); - const motions = trackStream(isApiReady ? api.query.council.proposals : undefined, []); + const motions = trackStream(isApiReady ? api.query.council?.proposals : undefined, []); const [counter, setCounter] = useState(0); useEffect((): void => { diff --git a/packages/app-tech-comm/src/useCounter.ts b/packages/app-tech-comm/src/useCounter.ts index 0d67129dde4e..92f1e1b635cb 100644 --- a/packages/app-tech-comm/src/useCounter.ts +++ b/packages/app-tech-comm/src/useCounter.ts @@ -9,7 +9,7 @@ import { useApi, trackStream } from '@polkadot/react-hooks'; export default function useCounter (): number { const { api, isApiReady } = useApi(); - const proposals = trackStream(isApiReady ? api.query.technicalCommittee.proposals : undefined, []); + const proposals = trackStream(isApiReady ? api.query.technicalCommittee && api.query.technicalCommittee.proposals : undefined, []); const [counter, setCounter] = useState(0); useEffect((): void => {