mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-01-23 00:56:23 +01:00
Fix Account sheet relationship check not working when clicking from Settings page
This is because accounts from different instances have different IDs! They're NOT unique cross-instance. So while on one instance, cannot use the account ID of the other instance to query for relationship because the ID doesn't exist on *current* instance.
This commit is contained in:
parent
3daa7e4f9d
commit
86f38ee3b8
2 changed files with 10 additions and 2 deletions
|
@ -5,7 +5,7 @@ import states from '../utils/states';
|
||||||
|
|
||||||
import Avatar from './avatar';
|
import Avatar from './avatar';
|
||||||
|
|
||||||
function NameText({ account, showAvatar, showAcct, short, external }) {
|
function NameText({ account, showAvatar, showAcct, short, external, onClick }) {
|
||||||
const { acct, avatar, avatarStatic, id, url, displayName, emojis } = account;
|
const { acct, avatar, avatarStatic, id, url, displayName, emojis } = account;
|
||||||
let { username } = account;
|
let { username } = account;
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@ function NameText({ account, showAvatar, showAcct, short, external }) {
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
if (external) return;
|
if (external) return;
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
if (onClick) return onClick(e);
|
||||||
states.showAccount = account;
|
states.showAccount = account;
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
|
@ -5,6 +5,7 @@ import { useRef, useState } from 'preact/hooks';
|
||||||
import Avatar from '../components/avatar';
|
import Avatar from '../components/avatar';
|
||||||
import Icon from '../components/icon';
|
import Icon from '../components/icon';
|
||||||
import NameText from '../components/name-text';
|
import NameText from '../components/name-text';
|
||||||
|
import states from '../utils/states';
|
||||||
import store from '../utils/store';
|
import store from '../utils/store';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -42,7 +43,13 @@ function Settings({ onClose }) {
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
<Avatar url={account.info.avatarStatic} size="xxl" />
|
<Avatar url={account.info.avatarStatic} size="xxl" />
|
||||||
<NameText account={account.info} showAcct />
|
<NameText
|
||||||
|
account={account.info}
|
||||||
|
showAcct
|
||||||
|
onClick={() => {
|
||||||
|
states.showAccount = `${account.info.username}@${account.instanceURL}`;
|
||||||
|
}}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
{isDefault && moreThanOneAccount && (
|
{isDefault && moreThanOneAccount && (
|
||||||
|
|
Loading…
Reference in a new issue