Use pinned instead of _pinned
This commit is contained in:
parent
b3681a93ee
commit
89e8bdf77b
1 changed files with 6 additions and 7 deletions
|
@ -283,6 +283,7 @@ function Status({
|
||||||
url,
|
url,
|
||||||
emojis,
|
emojis,
|
||||||
tags,
|
tags,
|
||||||
|
pinned,
|
||||||
// Non-API props
|
// Non-API props
|
||||||
_deleted,
|
_deleted,
|
||||||
_pinned,
|
_pinned,
|
||||||
|
@ -1122,22 +1123,20 @@ function Status({
|
||||||
try {
|
try {
|
||||||
const newStatus = await masto.v1.statuses
|
const newStatus = await masto.v1.statuses
|
||||||
.$select(id)
|
.$select(id)
|
||||||
[_pinned ? 'unpin' : 'pin']();
|
[pinned ? 'unpin' : 'pin']();
|
||||||
// saveStatus(newStatus, instance);
|
saveStatus(newStatus, instance);
|
||||||
showToast(
|
showToast(
|
||||||
_pinned
|
pinned
|
||||||
? 'Post unpinned from profile'
|
? 'Post unpinned from profile'
|
||||||
: 'Post pinned to profile',
|
: 'Post pinned to profile',
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
showToast(
|
showToast(pinned ? 'Unable to unpin post' : 'Unable to pin post');
|
||||||
_pinned ? 'Unable to unpin post' : 'Unable to pin post',
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{_pinned ? (
|
{pinned ? (
|
||||||
<>
|
<>
|
||||||
<Icon icon="unpin" />
|
<Icon icon="unpin" />
|
||||||
<span>Unpin from profile</span>
|
<span>Unpin from profile</span>
|
||||||
|
|
Loading…
Add table
Reference in a new issue