fix: update Plebbit.getShortAddress calls to use object parameter

This commit is contained in:
plebeius
2025-12-24 13:29:09 +01:00
parent 0f7b50b573
commit 4cb3bda38c
9 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -71,7 +71,7 @@ const BoardHeader = () => {
? shortAddress.endsWith('.eth') || shortAddress.endsWith('.sol')
? shortAddress.slice(0, -4)
: shortAddress
: subplebbitAddress && Plebbit.getShortAddress(subplebbitAddress))}
: subplebbitAddress && Plebbit.getShortAddress({ address: subplebbitAddress }))}
{(isOffline || isOnlineStatusLoading) && !isInAllView && !isInSubscriptionsView && !isInModView && (
<span className={styles.offlineIconWrapper}>
<Tooltip content={offlineTitle}>
+1 -1
View File
@@ -288,7 +288,7 @@ const CatalogPost = ({ post }: { post: Comment }) => {
{author?.displayName || _.capitalize(t('anonymous'))}
{isCatalogPostAuthorMod && <span className='capitalize'>{` ## Board ${catalogPostAuthorRole}`}</span>}
</span>
{(isInAllView || isInSubscriptionsView) && subplebbitAddress && ` to p/${Plebbit.getShortAddress(subplebbitAddress)}`}
{(isInAllView || isInSubscriptionsView) && subplebbitAddress && ` to p/${Plebbit.getShortAddress({ address: subplebbitAddress })}`}
<span className={styles.postAgo}> {getFormattedTimeAgo(timestamp)}</span>
{replyCount > 0 && (
<div className={styles.postLast}>
@@ -116,7 +116,7 @@ const CommentContent = ({ comment: post }: { comment: Comment }) => {
<Tooltip
children={`(${t('user_banned')})`}
content={`${t('ban_expires_at', {
address: subplebbitAddress && Plebbit.getShortAddress(subplebbitAddress),
address: subplebbitAddress && Plebbit.getShortAddress({ address: subplebbitAddress }),
timestamp: getFormattedDate(commentAuthor?.banExpiresAt),
interpolation: { escapeValue: false },
})}${reason ? `. ${_.capitalize(t('reason'))}: "${reason}"` : ''}`}
+1 -1
View File
@@ -71,7 +71,7 @@ const PostInfo = ({ post, postReplyCount = 0, roles, isHidden }: PostProps) => {
const location = useLocation();
const isInPostPageView = isPostPageView(location.pathname, params);
const userID = address && Plebbit.getShortAddress(address);
const userID = address && Plebbit.getShortAddress({ address });
const userIDBackgroundColor = hashStringToColor(userID);
const userIDTextColor = getTextColorForBackground(userIDBackgroundColor);
+1 -1
View File
@@ -335,7 +335,7 @@ const PostFormTable = ({ closeForm, postCid }: { closeForm: () => void; postCid:
{isInModView &&
accountSubplebbitAddresses.map((address: string) => (
<option key={address} value={address}>
{address && Plebbit.getShortAddress(address)}
{address && Plebbit.getShortAddress({ address })}
</option>
))}
{isInSubscriptionsView &&
+1 -1
View File
@@ -75,7 +75,7 @@ const PostInfoAndMedia = ({ post, postReplyCount = 0, roles }: PostProps) => {
const handleUserAddressClick = useAuthorAddressClick();
const numberOfPostsByAuthor = document.querySelectorAll(`[data-author-address="${shortAddress}"][data-post-cid="${postCid}"]`).length;
const userID = address && Plebbit.getShortAddress(address);
const userID = address && Plebbit.getShortAddress({ address });
const userIDBackgroundColor = hashStringToColor(userID);
const userIDTextColor = getTextColorForBackground(userIDBackgroundColor);
@@ -44,7 +44,7 @@ const BlockedAddressesSetting = () => {
<ul className={styles.blockedAddresses}>
{addressList.map((address: string) => (
<li key={address} className={styles.blockedAddress}>
{address && Plebbit.getShortAddress(address)} <UnblockButton address={address} />
{address && Plebbit.getShortAddress({ address })} <UnblockButton address={address} />
</li>
))}
</ul>
@@ -57,7 +57,7 @@ const SubscriptionsSetting = () => {
<ul className={styles.subscriptions}>
{subscriptions?.map((address: string) => (
<li key={address} className={styles.subscription}>
{address && Plebbit.getShortAddress(address)} <SubscriptionButton address={address} />
{address && Plebbit.getShortAddress({ address })} <SubscriptionButton address={address} />
</li>
))}
</ul>
+1 -1
View File
@@ -166,7 +166,7 @@ const TopBarDesktop = () => {
// Render a subscription link
const renderSubscription = (address: string, index: number, total: number) => {
const boardPath = getBoardPath(address, defaultSubplebbits);
const displayText = address.endsWith('.eth') || address.endsWith('.sol') ? address : Plebbit.getShortAddress(address);
const displayText = address.endsWith('.eth') || address.endsWith('.sol') ? address : Plebbit.getShortAddress({ address });
return (
<span key={address}>