diff --git a/src/pages/status.jsx b/src/pages/status.jsx
index c22e6bc0..8d3a488e 100644
--- a/src/pages/status.jsx
+++ b/src/pages/status.jsx
@@ -40,8 +40,12 @@ function resetScrollPosition(id) {
function StatusPage() {
const { id, ...params } = useParams();
- const { masto, instance, authenticated } = api({ instance: params.instance });
- const { masto: currentMasto, instance: currentInstance } = api();
+ const { masto, instance } = api({ instance: params.instance });
+ const {
+ masto: currentMasto,
+ instance: currentInstance,
+ authenticated,
+ } = api();
const sameInstance = instance === currentInstance;
const navigate = useNavigate();
const snapStates = useSnapshot(states);
@@ -622,55 +626,59 @@ function StatusPage() {
size="l"
/>
- {!sameInstance && uiState !== 'loading' && (
+ {uiState !== 'loading' && !authenticated ? (
- This post is from another instance (
- {instance} ). Interactions (reply, boost, etc)
- are not possible.
+ You're not logged in. Interactions (reply, boost,
+ etc) are not possible.
-
{
- (async () => {
- try {
- const results = await currentMasto.v2.search({
- q: heroStatus.url,
- type: 'statuses',
- resolve: true,
- limit: 1,
- });
- if (results.statuses.length) {
- const status = results.statuses[0];
- navigate(`/s/${status.id}`);
- } else {
- throw new Error('No results');
- }
- } catch (e) {
- alert('Error: ' + e);
- console.error(e);
- }
- })();
- }}
- >
- Switch to my instance to
- enable interactions
-
+
+ Log in
+
- )}
- {sameInstance &&
- !authenticated &&
- uiState !== 'loading' && (
+ ) : (
+ !sameInstance && (
- You're not logged in. Interactions (reply, boost,
+ This post is from another instance (
+ {instance} ). Interactions (reply, boost,
etc) are not possible.
-
- Log in
-
+
{
+ (async () => {
+ try {
+ const results =
+ await currentMasto.v2.search({
+ q: heroStatus.url,
+ type: 'statuses',
+ resolve: true,
+ limit: 1,
+ });
+ if (results.statuses.length) {
+ const status = results.statuses[0];
+ navigate(
+ currentInstance
+ ? `/${currentInstance}/s/${status.id}`
+ : `/s/${status.id}`,
+ );
+ } else {
+ throw new Error('No results');
+ }
+ } catch (e) {
+ alert('Error: ' + e);
+ console.error(e);
+ }
+ })();
+ }}
+ >
+ Switch to my instance to
+ enable interactions
+
- )}
+ )
+ )}
>
) : (