mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
refactor: migrate 5chan to the community hooks API (#1073)
* 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
This commit is contained in:
@@ -85,7 +85,7 @@ export const getBoardPath = (communityAddress: string, communities: DirectoryCom
|
||||
/**
|
||||
* Convert URL path (directory code or address) to community address
|
||||
*/
|
||||
export const getSubplebbitAddress = (boardIdentifier: string, communities: DirectoryCommunity[]): string => {
|
||||
export const getCommunityAddress = (boardIdentifier: string, communities: DirectoryCommunity[]): string => {
|
||||
const directoryToAddress = getDirectoryToAddressMap(communities);
|
||||
|
||||
// Check if it's a directory code
|
||||
@@ -98,6 +98,11 @@ export const getSubplebbitAddress = (boardIdentifier: string, communities: Direc
|
||||
return boardIdentifier;
|
||||
};
|
||||
|
||||
/**
|
||||
* Back-compat alias kept for route params and comments.
|
||||
*/
|
||||
export const getSubplebbitAddress = getCommunityAddress;
|
||||
|
||||
/**
|
||||
* Compare two addresses; returns true if they refer to the same board (handles .bso/.eth aliases).
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user