mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
* refactor(community-api): migrate 5chan to community hooks * fix(review): address PR feedback * fix(review): preserve legacy board context fallbacks * fix(review): address latest bot feedback * fix(review): use communityAddress in edit menu privileges
14 lines
657 B
TypeScript
14 lines
657 B
TypeScript
import { useDirectoryByAddress } from './use-directories';
|
|
import { useCommunityField } from './use-stable-community';
|
|
|
|
/**
|
|
* Prefer authoritative live board metadata when available, but fall back to the
|
|
* bundled directory entry so known boards can render IDs immediately on first load.
|
|
*/
|
|
export const useBoardPseudonymityMode = (communityAddress: string | undefined): string | undefined => {
|
|
const directory = useDirectoryByAddress(communityAddress);
|
|
const livePseudonymityMode = useCommunityField(communityAddress, (community) => community?.features?.pseudonymityMode);
|
|
|
|
return livePseudonymityMode ?? directory?.features?.pseudonymityMode;
|
|
};
|