feat: UserState

This commit is contained in:
2024-04-22 14:38:14 +01:00
parent 5a7657a95d
commit 80a4b5d8e6
103 changed files with 4179 additions and 1165 deletions

View File

@ -17,15 +17,15 @@ enum Provider {
}
export default function SuggestedProfiles() {
const login = useLogin(s => ({ publicKey: s.publicKey, follows: s.contacts }));
const publicKey = useLogin(s => s.publicKey);
const [provider, setProvider] = useState(Provider.NostrBand);
const getUrlAndKey = () => {
if (!login.publicKey) return { url: null, key: null };
if (!publicKey) return { url: null, key: null };
switch (provider) {
case Provider.NostrBand: {
const api = new NostrBandApi();
const url = api.suggestedFollowsUrl(hexToBech32(NostrPrefix.PublicKey, login.publicKey));
const url = api.suggestedFollowsUrl(hexToBech32(NostrPrefix.PublicKey, publicKey));
return { url, key: `nostr-band-${url}` };
}
default: