Centralize Matrix SDK imports behind a local compatibility module, migrate matrix subpath imports to the boundary, and switch to the $types alias. Upgrade TypeScript to latest so matrix-js-sdk typings resolve correctly before the next cleanup phase.
13 lines
417 B
TypeScript
13 lines
417 B
TypeScript
import { ValidatedAuthMetadata } from '$types/matrix-sdk';
|
|
import { createContext, useContext } from 'react';
|
|
|
|
const AuthMetadataContext = createContext<ValidatedAuthMetadata | undefined>(undefined);
|
|
|
|
export const AuthMetadataProvider = AuthMetadataContext.Provider;
|
|
|
|
export const useAuthMetadata = (): ValidatedAuthMetadata | undefined => {
|
|
const metadata = useContext(AuthMetadataContext);
|
|
|
|
return metadata;
|
|
};
|