Conform more of the codebase to strictNullChecks (#10505
* Conform more of the codebase to `strictNullChecks` * Iterate * Conform more of the codebase to `strictNullChecks` * Iterate * Iterate * Iterate * Iterate
This commit is contained in:
parent
7503bf6b96
commit
e5a314617a
21 changed files with 76 additions and 83 deletions
|
@ -995,19 +995,8 @@ export const RoomAdminToolsContainer: React.FC<IBaseRoomProps> = ({
|
|||
return <div />;
|
||||
};
|
||||
|
||||
const useIsSynapseAdmin = (cli: MatrixClient): boolean => {
|
||||
const [isAdmin, setIsAdmin] = useState(false);
|
||||
useEffect(() => {
|
||||
cli.isSynapseAdministrator().then(
|
||||
(isAdmin) => {
|
||||
setIsAdmin(isAdmin);
|
||||
},
|
||||
() => {
|
||||
setIsAdmin(false);
|
||||
},
|
||||
);
|
||||
}, [cli]);
|
||||
return isAdmin;
|
||||
const useIsSynapseAdmin = (cli?: MatrixClient): boolean => {
|
||||
return useAsyncMemo(async () => (cli ? cli.isSynapseAdministrator().catch(() => false) : false), [cli], false);
|
||||
};
|
||||
|
||||
const useHomeserverSupportsCrossSigning = (cli: MatrixClient): boolean => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue