Skip to content

Commit

Permalink
Use pinned instead of _pinned
Browse files Browse the repository at this point in the history
  • Loading branch information
cheeaun committed Aug 4, 2024
1 parent b3681a9 commit 89e8bdf
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/components/status.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ function Status({
url,
emojis,
tags,
pinned,
// Non-API props
_deleted,
_pinned,
Expand Down Expand Up @@ -1122,22 +1123,20 @@ function Status({
try {
const newStatus = await masto.v1.statuses
.$select(id)
[_pinned ? 'unpin' : 'pin']();
// saveStatus(newStatus, instance);
[pinned ? 'unpin' : 'pin']();
saveStatus(newStatus, instance);
showToast(
_pinned
pinned
? 'Post unpinned from profile'
: 'Post pinned to profile',
);
} catch (e) {
console.error(e);
showToast(
_pinned ? 'Unable to unpin post' : 'Unable to pin post',
);
showToast(pinned ? 'Unable to unpin post' : 'Unable to pin post');
}
}}
>
{_pinned ? (
{pinned ? (
<>
<Icon icon="unpin" />
<span>Unpin from profile</span>
Expand Down

0 comments on commit 89e8bdf

Please sign in to comment.