diff --git a/src/components/account-info.jsx b/src/components/account-info.jsx
index 475b61b9..15d303d1 100644
--- a/src/components/account-info.jsx
+++ b/src/components/account-info.jsx
@@ -917,6 +917,7 @@ function RelatedActions({
const [showTranslatedBio, setShowTranslatedBio] = useState(false);
const [showAddRemoveLists, setShowAddRemoveLists] = useState(false);
const [showPrivateNoteModal, setShowPrivateNoteModal] = useState(false);
+ const [lists, setLists] = useState([]);
return (
<>
@@ -976,6 +977,22 @@ function RelatedActions({
}
+ onMenuChange={(e) => {
+ if (following && e.open) {
+ // Fetch lists that have this account
+ (async () => {
+ try {
+ const lists = await currentMasto.v1.accounts
+ .$select(accountID.current)
+ .lists.list();
+ console.log('fetched account lists', lists);
+ setLists(lists);
+ } catch (e) {
+ console.error(e);
+ }
+ })();
+ }
+ }}
>
{currentAuthenticated && !isSelf && (
<>
@@ -1017,7 +1034,20 @@ function RelatedActions({
}}
>
- Add/remove from Lists
+ {lists.length ? (
+ <>
+
+ {lists.length}
+ >
+ ) : (
+ Add/Remove from Lists
+ )}
)}