refactor: reactions grouping and other fixes
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import { dedupe } from "@snort/shared";
|
||||
import { EventKind, NoteCollection, RequestBuilder } from "@snort/system";
|
||||
import { EventKind, RequestBuilder } from "@snort/system";
|
||||
import { useRequestBuilder } from "@snort/system-react";
|
||||
import classNames from "classnames";
|
||||
import { useMemo } from "react";
|
||||
@ -59,8 +59,8 @@ export function HashTagHeader({ tag, events, className }: { tag: string; events?
|
||||
rb.withFilter().kinds([EventKind.InterestsList]).tag("t", [tag.toLowerCase()]);
|
||||
return rb;
|
||||
}, [tag]);
|
||||
const followsTag = useRequestBuilder(NoteCollection, sub);
|
||||
const pubkeys = dedupe((followsTag.data ?? []).map(a => a.pubkey));
|
||||
const followsTag = useRequestBuilder(sub);
|
||||
const pubkeys = dedupe(followsTag.map(a => a.pubkey));
|
||||
|
||||
return (
|
||||
<div className={classNames("flex flex-col", className)}>
|
||||
|
@ -103,10 +103,10 @@ function NoteTitle({ link }: { link: NostrLink }) {
|
||||
const ev = useEventFeed(link);
|
||||
|
||||
const values = useMemo(() => {
|
||||
return { name: <DisplayName pubkey={ev.data?.pubkey ?? ""} /> };
|
||||
}, [ev.data?.pubkey]);
|
||||
return { name: <DisplayName pubkey={ev?.pubkey ?? ""} /> };
|
||||
}, [ev?.pubkey]);
|
||||
|
||||
if (!ev.data?.pubkey) {
|
||||
if (!ev?.pubkey) {
|
||||
return <FormattedMessage defaultMessage="Note" id="qMePPG" />;
|
||||
}
|
||||
|
||||
|
@ -6,8 +6,8 @@ import ProfilePreview from "@/Components/User/ProfilePreview";
|
||||
|
||||
export default function Nip28ChatProfile({ id, onClick }: { id: string; onClick: (id: string) => void }) {
|
||||
const channel = useEventFeed(new NostrLink(CONFIG.eventLinkPrefix, id, 40));
|
||||
if (channel?.data) {
|
||||
const meta = JSON.parse(channel.data.content) as UserMetadata;
|
||||
if (channel) {
|
||||
const meta = JSON.parse(channel.content) as UserMetadata;
|
||||
return (
|
||||
<ProfilePreview
|
||||
pubkey=""
|
||||
|
@ -252,7 +252,7 @@ function NotificationGroup({ evs, onClick }: { evs: Array<TaggedNostrEvent>; onC
|
||||
}
|
||||
|
||||
function NotificationContext({ link, onClick }: { link: NostrLink; onClick: () => void }) {
|
||||
const { data: ev } = useEventFeed(link);
|
||||
const ev = useEventFeed(link);
|
||||
if (link.type === NostrPrefix.PublicKey) {
|
||||
return <ProfilePreview pubkey={link.id} actions={<></>} />;
|
||||
}
|
||||
|
@ -415,7 +415,6 @@ const PreferencesPage = () => {
|
||||
value={perf.reactionEmoji}
|
||||
onChange={e => {
|
||||
const split = e.target.value.match(/[\p{L}\S]{1}/u);
|
||||
console.debug(e.target.value, split);
|
||||
updatePreferences(id, {
|
||||
...perf,
|
||||
reactionEmoji: split?.[0] ?? "",
|
||||
|
@ -19,7 +19,6 @@ export default function AlbyOAuth() {
|
||||
async function setupWallet(token: string) {
|
||||
try {
|
||||
const auth = await alby.getToken(token);
|
||||
console.debug(auth);
|
||||
const connection = new AlbyWallet(auth, () => {});
|
||||
const info = await connection.getInfo();
|
||||
|
||||
|
Reference in New Issue
Block a user