mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-26 03:05:41 +03:00
Use instance check instead of authenticated check
This commit is contained in:
parent
b06cd36b3f
commit
9e1f62e47b
1 changed files with 8 additions and 6 deletions
|
@ -59,7 +59,9 @@ function Status({
|
|||
</div>
|
||||
);
|
||||
}
|
||||
const { masto, instance, authenticated } = api({ instance: propInstance });
|
||||
const { masto, instance } = api({ instance: propInstance });
|
||||
const { instance: currentInstance } = api();
|
||||
const sameInstance = instance === currentInstance;
|
||||
|
||||
const sKey = statusKey(statusID, instance);
|
||||
const snapStates = useSnapshot(states);
|
||||
|
@ -380,7 +382,7 @@ function Status({
|
|||
<Poll
|
||||
lang={language}
|
||||
poll={poll}
|
||||
readOnly={readOnly || !authenticated}
|
||||
readOnly={readOnly || !sameInstance}
|
||||
onUpdate={(newPoll) => {
|
||||
states.statuses[sKey].poll = newPoll;
|
||||
}}
|
||||
|
@ -509,7 +511,7 @@ function Status({
|
|||
icon="comment"
|
||||
count={repliesCount}
|
||||
onClick={() => {
|
||||
if (!authenticated) {
|
||||
if (!sameInstance) {
|
||||
return alert(unauthInteractionErrorMessage);
|
||||
}
|
||||
states.showCompose = {
|
||||
|
@ -529,7 +531,7 @@ function Status({
|
|||
icon="rocket"
|
||||
count={reblogsCount}
|
||||
onClick={async () => {
|
||||
if (!authenticated) {
|
||||
if (!sameInstance) {
|
||||
return alert(unauthInteractionErrorMessage);
|
||||
}
|
||||
try {
|
||||
|
@ -572,7 +574,7 @@ function Status({
|
|||
icon="heart"
|
||||
count={favouritesCount}
|
||||
onClick={async () => {
|
||||
if (!authenticated) {
|
||||
if (!sameInstance) {
|
||||
return alert(unauthInteractionErrorMessage);
|
||||
}
|
||||
try {
|
||||
|
@ -608,7 +610,7 @@ function Status({
|
|||
class="bookmark-button"
|
||||
icon="bookmark"
|
||||
onClick={async () => {
|
||||
if (!authenticated) {
|
||||
if (!sameInstance) {
|
||||
return alert(unauthInteractionErrorMessage);
|
||||
}
|
||||
try {
|
||||
|
|
Loading…
Reference in a new issue