Fix collapsed peek status with wrong url

This commit is contained in:
Lim Chee Aun 2023-11-05 17:40:58 +08:00
parent 83bdc82049
commit 305710fa8c

View file

@ -268,6 +268,7 @@ function Status({
instance={instance}
size={size}
contentTextWeight={contentTextWeight}
readOnly={readOnly}
/>
</div>
);
@ -290,6 +291,7 @@ function Status({
instance={instance}
size={size}
contentTextWeight={contentTextWeight}
readOnly={readOnly}
/>
</div>
);
@ -2276,6 +2278,7 @@ const unfurlMastodonLink = throttle(_unfurlMastodonLink);
function FilteredStatus({ status, filterInfo, instance, containerProps = {} }) {
const {
id: statusID,
account: { avatar, avatarStatic, bot, group },
createdAt,
visibility,
@ -2305,6 +2308,11 @@ function FilteredStatus({ status, filterInfo, instance, containerProps = {} }) {
' ' +
(statusKey(reblog?.id, instance) || '');
const actualStatusID = reblog?.id || statusID;
const url = instance
? `/${instance}/s/${actualStatusID}`
: `/s/${actualStatusID}`;
return (
<div
class={isReblog ? (group ? 'status-group' : 'status-reblog') : ''}
@ -2380,7 +2388,7 @@ function FilteredStatus({ status, filterInfo, instance, containerProps = {} }) {
<Link
ref={statusPeekRef}
class="status-link"
to={`/${instance}/s/${status.id}`}
to={url}
onClick={() => {
setShowPeek(false);
}}