2026-03-07 12:46:37 +08:00
|
|
|
import { useDirectoryByAddress } from './use-directories';
|
2026-03-13 13:25:10 +08:00
|
|
|
import { useCommunityField } from './use-stable-community';
|
2026-03-07 12:46:37 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
2026-03-13 13:25:10 +08:00
|
|
|
export const useBoardPseudonymityMode = (communityAddress: string | undefined): string | undefined => {
|
|
|
|
|
const directory = useDirectoryByAddress(communityAddress);
|
|
|
|
|
const livePseudonymityMode = useCommunityField(communityAddress, (community) => community?.features?.pseudonymityMode);
|
2026-03-07 12:46:37 +08:00
|
|
|
|
|
|
|
|
return livePseudonymityMode ?? directory?.features?.pseudonymityMode;
|
|
|
|
|
};
|