mirror of
https://github.com/PrimalHQ/primal-web-app.git
synced 2024-09-29 00:10:50 +00:00
Fix issues with replies and contacts UI. Broaden reply filter
This commit is contained in:
parent
35b060dc70
commit
d48916917f
@ -24,6 +24,7 @@ const FeedSelect: Component<{ isPhone?: boolean, id?: string}> = (props) => {
|
||||
};
|
||||
|
||||
const selectFeed = (option: FeedOption) => {
|
||||
|
||||
const [hex, includeReplies] = option.value?.split('_') || [];
|
||||
const selector = document.getElementById('defocus');
|
||||
|
||||
|
@ -67,7 +67,7 @@
|
||||
}
|
||||
}
|
||||
.replyingTo {
|
||||
font-size: 15px;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
line-height: 16px;
|
||||
.label {
|
||||
|
@ -27,7 +27,9 @@ const ProfileContact: Component<{
|
||||
|
||||
return (
|
||||
<div id={props.id} class={styles.profileContact}>
|
||||
<Avatar src={props.profile?.picture} size="sm" />
|
||||
<A href={`/p/${props.profile?.npub}`}>
|
||||
<Avatar src={props.profile?.picture} size="sm" />
|
||||
</A>
|
||||
|
||||
<A href={`/p/${props.profile?.npub}`} class={styles.info}>
|
||||
<div class={styles.profileInfo}>
|
||||
|
@ -242,7 +242,7 @@ export const HomeProvider = (props: { children: ContextChildren }) => {
|
||||
|
||||
const selectFeed = (feed: PrimalFeed | undefined) => {
|
||||
if (feed !== undefined && feed.hex !== undefined) {
|
||||
updateStore('selectedFeed', reconcile(feed ));
|
||||
updateStore('selectedFeed', reconcile({...feed}));
|
||||
clearNotes();
|
||||
fetchNotes(feed.hex , `${APP_ID}`, 0, feed.includeReplies);
|
||||
}
|
||||
|
@ -149,7 +149,27 @@ export const convertToNotes: ConvertToNotes = (page) => {
|
||||
const mentionIds = Object.keys(mentions) //message.tags.reduce((acc, t) => t[0] === 'e' ? [...acc, t[1]] : acc, []);
|
||||
const userMentionIds = message.tags.reduce((acc, t) => t[0] === 'p' ? [...acc, t[1]] : acc, []);
|
||||
|
||||
const replyTo = message.tags.find(t => t[0] === 'e' && (t[3] === 'root' || t[3] === 'reply')) ;
|
||||
let replyTo: string[] | undefined;
|
||||
|
||||
// Determine parent by finding the `e` tag with `reply` then `root` as `marker`
|
||||
// If both fail return the last `e` tag
|
||||
for (let i=0; i<message.tags.length; i++) {
|
||||
const tag = message.tags[i];
|
||||
|
||||
if (tag[0] !== 'e') continue;
|
||||
|
||||
if (tag[3] === 'reply') {
|
||||
replyTo = [...tag];
|
||||
break;
|
||||
}
|
||||
|
||||
if (tag[3] === 'root') {
|
||||
replyTo = [...tag];
|
||||
break;
|
||||
}
|
||||
|
||||
replyTo = [...tag];
|
||||
}
|
||||
|
||||
let mentionedNotes: Record<string, PrimalNote> = {};
|
||||
let mentionedUsers: Record<string, PrimalUser> = {};
|
||||
|
Loading…
Reference in New Issue
Block a user