fix: handle optional chaining for suspended candidates query (#11469)

This commit is contained in:
Arjun Porwal 2025-04-10 10:43:31 +05:30 committed by GitHub
parent 50419fba4b
commit 75fcca85db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -46,7 +46,7 @@ const OPT_ACC = {
function Suspended ({ className }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
const { api } = useApi();
const candidates = useCall<CandidateSuspend[]>(api.query.society.suspendedCandidates.entries, undefined, OPT_CAN);
const candidates = useCall<CandidateSuspend[]>(api.query.society.suspendedCandidates?.entries, undefined, OPT_CAN) ?? [];
const members = useCall<AccountId[]>(api.query.society.suspendedMembers.keys, undefined, OPT_ACC);
const headerRef = useRef({