From 4cb3bda38c2f46029b87c2f9a6d65a8b4f9c8d63 Mon Sep 17 00:00:00 2001 From: plebeius Date: Wed, 24 Dec 2025 13:29:09 +0100 Subject: [PATCH] fix: update Plebbit.getShortAddress calls to use object parameter --- src/components/board-header/board-header.tsx | 2 +- src/components/catalog-row/catalog-row.tsx | 2 +- src/components/comment-content/comment-content.tsx | 2 +- src/components/post-desktop/post-desktop.tsx | 2 +- src/components/post-form/post-form.tsx | 2 +- src/components/post-mobile/post-mobile.tsx | 2 +- .../blocked-addresses-setting/blocked-addresses-setting.tsx | 2 +- .../subscriptions-setting/subscriptions-setting.tsx | 2 +- src/components/topbar/topbar.tsx | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/board-header/board-header.tsx b/src/components/board-header/board-header.tsx index 740b7969..c7a4adbc 100644 --- a/src/components/board-header/board-header.tsx +++ b/src/components/board-header/board-header.tsx @@ -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 && ( diff --git a/src/components/catalog-row/catalog-row.tsx b/src/components/catalog-row/catalog-row.tsx index 58ef204c..f655fb9d 100644 --- a/src/components/catalog-row/catalog-row.tsx +++ b/src/components/catalog-row/catalog-row.tsx @@ -288,7 +288,7 @@ const CatalogPost = ({ post }: { post: Comment }) => { {author?.displayName || _.capitalize(t('anonymous'))} {isCatalogPostAuthorMod && {` ## Board ${catalogPostAuthorRole}`}} - {(isInAllView || isInSubscriptionsView) && subplebbitAddress && ` to p/${Plebbit.getShortAddress(subplebbitAddress)}`} + {(isInAllView || isInSubscriptionsView) && subplebbitAddress && ` to p/${Plebbit.getShortAddress({ address: subplebbitAddress })}`} {getFormattedTimeAgo(timestamp)} {replyCount > 0 && (
diff --git a/src/components/comment-content/comment-content.tsx b/src/components/comment-content/comment-content.tsx index d8967417..6129445c 100644 --- a/src/components/comment-content/comment-content.tsx +++ b/src/components/comment-content/comment-content.tsx @@ -116,7 +116,7 @@ const CommentContent = ({ comment: post }: { comment: Comment }) => { { 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); diff --git a/src/components/post-form/post-form.tsx b/src/components/post-form/post-form.tsx index 5e2b1dcb..529bc61c 100644 --- a/src/components/post-form/post-form.tsx +++ b/src/components/post-form/post-form.tsx @@ -335,7 +335,7 @@ const PostFormTable = ({ closeForm, postCid }: { closeForm: () => void; postCid: {isInModView && accountSubplebbitAddresses.map((address: string) => ( ))} {isInSubscriptionsView && diff --git a/src/components/post-mobile/post-mobile.tsx b/src/components/post-mobile/post-mobile.tsx index de1122cf..197d6246 100644 --- a/src/components/post-mobile/post-mobile.tsx +++ b/src/components/post-mobile/post-mobile.tsx @@ -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); diff --git a/src/components/settings-modal/blocked-addresses-setting/blocked-addresses-setting.tsx b/src/components/settings-modal/blocked-addresses-setting/blocked-addresses-setting.tsx index 6926a521..edad0f52 100644 --- a/src/components/settings-modal/blocked-addresses-setting/blocked-addresses-setting.tsx +++ b/src/components/settings-modal/blocked-addresses-setting/blocked-addresses-setting.tsx @@ -44,7 +44,7 @@ const BlockedAddressesSetting = () => {
    {addressList.map((address: string) => (
  • - {address && Plebbit.getShortAddress(address)} + {address && Plebbit.getShortAddress({ address })}
  • ))}
diff --git a/src/components/settings-modal/subscriptions-setting/subscriptions-setting.tsx b/src/components/settings-modal/subscriptions-setting/subscriptions-setting.tsx index eb2bb6dd..d5418394 100644 --- a/src/components/settings-modal/subscriptions-setting/subscriptions-setting.tsx +++ b/src/components/settings-modal/subscriptions-setting/subscriptions-setting.tsx @@ -57,7 +57,7 @@ const SubscriptionsSetting = () => {
    {subscriptions?.map((address: string) => (
  • - {address && Plebbit.getShortAddress(address)} + {address && Plebbit.getShortAddress({ address })}
  • ))}
diff --git a/src/components/topbar/topbar.tsx b/src/components/topbar/topbar.tsx index 19cc0865..d5b4bb6d 100644 --- a/src/components/topbar/topbar.tsx +++ b/src/components/topbar/topbar.tsx @@ -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 (