* Rework collective queries * members derive * All via derive * Adjust society useMembers * Adjust optional consts * Detect council module locations * Adjust tech comm with module locations * Rework loading * Unused type import
23 lines
536 B
TypeScript
23 lines
536 B
TypeScript
// Copyright 2017-2021 @polkadot/app-council authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import { useMemo } from 'react';
|
|
|
|
import { useApi } from '@polkadot/react-hooks';
|
|
|
|
export function useModuleElections (): string | null {
|
|
const { api } = useApi();
|
|
|
|
return useMemo(
|
|
(): string | null =>
|
|
api.tx.phragmenElection
|
|
? 'phragmenElection'
|
|
: api.tx.electionsPhragmen
|
|
? 'electionsPhragmen'
|
|
: api.tx.elections
|
|
? 'elections'
|
|
: null,
|
|
[api]
|
|
);
|
|
}
|