Fix load from note to note

This commit is contained in:
KoalaSat 2022-10-29 21:16:45 +02:00
parent 831a2a44cf
commit e4fba4f7e8
No known key found for this signature in database
GPG Key ID: 2F7F61C6146AB157

View File

@ -30,13 +30,13 @@ export const NotePage: React.FC = () => {
const breadcrump = page.split('%');
const eventId = breadcrump[breadcrump.length - 1].split('#')[1];
const reload: () => void = () => {
const reload: (newEventId?: string) => void = (newEventId) => {
setNote(undefined);
setReplies(undefined);
relayPool?.unsubscribeAll();
relayPool?.subscribe('main-channel', {
kinds: [EventKind.textNote],
ids: [eventId],
ids: [newEventId ?? eventId],
});
};
@ -82,7 +82,7 @@ export const NotePage: React.FC = () => {
const replyId = getReplyEventId(note);
if (replyId) {
goToPage(`note#${replyId}`);
reload();
reload(replyId);
}
}
};