mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-29 20:58:57 +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>
|
</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 sKey = statusKey(statusID, instance);
|
||||||
const snapStates = useSnapshot(states);
|
const snapStates = useSnapshot(states);
|
||||||
|
@ -380,7 +382,7 @@ function Status({
|
||||||
<Poll
|
<Poll
|
||||||
lang={language}
|
lang={language}
|
||||||
poll={poll}
|
poll={poll}
|
||||||
readOnly={readOnly || !authenticated}
|
readOnly={readOnly || !sameInstance}
|
||||||
onUpdate={(newPoll) => {
|
onUpdate={(newPoll) => {
|
||||||
states.statuses[sKey].poll = newPoll;
|
states.statuses[sKey].poll = newPoll;
|
||||||
}}
|
}}
|
||||||
|
@ -509,7 +511,7 @@ function Status({
|
||||||
icon="comment"
|
icon="comment"
|
||||||
count={repliesCount}
|
count={repliesCount}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (!authenticated) {
|
if (!sameInstance) {
|
||||||
return alert(unauthInteractionErrorMessage);
|
return alert(unauthInteractionErrorMessage);
|
||||||
}
|
}
|
||||||
states.showCompose = {
|
states.showCompose = {
|
||||||
|
@ -529,7 +531,7 @@ function Status({
|
||||||
icon="rocket"
|
icon="rocket"
|
||||||
count={reblogsCount}
|
count={reblogsCount}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
if (!authenticated) {
|
if (!sameInstance) {
|
||||||
return alert(unauthInteractionErrorMessage);
|
return alert(unauthInteractionErrorMessage);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
@ -572,7 +574,7 @@ function Status({
|
||||||
icon="heart"
|
icon="heart"
|
||||||
count={favouritesCount}
|
count={favouritesCount}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
if (!authenticated) {
|
if (!sameInstance) {
|
||||||
return alert(unauthInteractionErrorMessage);
|
return alert(unauthInteractionErrorMessage);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
@ -608,7 +610,7 @@ function Status({
|
||||||
class="bookmark-button"
|
class="bookmark-button"
|
||||||
icon="bookmark"
|
icon="bookmark"
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
if (!authenticated) {
|
if (!sameInstance) {
|
||||||
return alert(unauthInteractionErrorMessage);
|
return alert(unauthInteractionErrorMessage);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue