From 7658a1d7a42c7c94dd3fdc877e99aa1b9a5969fe Mon Sep 17 00:00:00 2001 From: KoalaSat Date: Sun, 12 Feb 2023 12:18:18 +0100 Subject: [PATCH] Fix groups --- .../main/java/com/nostros/classes/Event.java | 66 +++++++++++------ frontend/Components/NoteCard/index.tsx | 70 +++++++++++-------- frontend/Components/ProfileData/index.tsx | 58 ++++++++++----- frontend/Components/TextContent/index.tsx | 70 ++++++++++--------- frontend/Pages/ConversationPage/index.tsx | 15 ++-- frontend/Pages/GlobalFeed/index.tsx | 20 +++--- frontend/Pages/GroupPage/index.tsx | 60 +++++++++++----- frontend/Pages/GroupsFeed/index.tsx | 23 +++--- frontend/Pages/MyFeed/index.tsx | 5 +- frontend/Pages/NotePage/index.tsx | 16 +++-- frontend/Pages/ProfilePage/index.tsx | 6 +- frontend/Pages/ReactionsFeed/index.tsx | 4 +- frontend/Pages/RepostsFeed/index.tsx | 6 +- index.js | 4 ++ 14 files changed, 254 insertions(+), 169 deletions(-) diff --git a/android/app/src/main/java/com/nostros/classes/Event.java b/android/app/src/main/java/com/nostros/classes/Event.java index a315624..c6d89fd 100644 --- a/android/app/src/main/java/com/nostros/classes/Event.java +++ b/android/app/src/main/java/com/nostros/classes/Event.java @@ -209,27 +209,6 @@ public class Event { database.replace("nostros_notes", null, values); } - protected void updateGroup(SQLiteDatabase database) throws JSONException { - JSONObject groupContent = new JSONObject(content); - JSONArray eTags = filterTags("e"); - String groupId = eTags.getJSONArray(0).getString(1); - String query = "SELECT created_at, pubkey FROM nostros_groups WHERE id = ?"; - @SuppressLint("Recycle") Cursor cursor = database.rawQuery(query, new String[] {groupId}); - - if (cursor.moveToFirst() && created_at > cursor.getInt(0) && pubkey.equals(cursor.getString(1))) { - ContentValues values = new ContentValues(); - values.put("name", groupContent.optString("name")); - values.put("about", groupContent.optString("about")); - values.put("picture", groupContent.optString("picture")); - - String whereClause = "id = ?"; - String[] whereArgs = new String[] { - groupId - }; - database.update("nostros_groups", values, whereClause, whereArgs); - } - } - protected void blockUser(SQLiteDatabase database) throws JSONException { JSONArray pTags = filterTags("p"); String groupId = pTags.getJSONArray(0).getString(1); @@ -266,19 +245,60 @@ public class Event { protected void saveGroup(SQLiteDatabase database) throws JSONException { JSONObject groupContent = new JSONObject(content); + String query = "SELECT created_at, pubkey FROM nostros_groups WHERE id = ?"; + @SuppressLint("Recycle") Cursor cursor = database.rawQuery(query, new String[] {id}); ContentValues values = new ContentValues(); - values.put("id", id); values.put("content", content); values.put("created_at", created_at); values.put("kind", kind); values.put("pubkey", pubkey); values.put("sig", sig); values.put("tags", tags.toString()); + + if (cursor.getCount() == 0) { + values.put("id", id); + values.put("name", groupContent.optString("name")); + values.put("about", groupContent.optString("about")); + values.put("picture", groupContent.optString("picture")); + database.insert("nostros_groups", null, values); + } else if (cursor.moveToFirst() && cursor.getString(0).isEmpty()) { + String whereClause = "id = ?"; + String[] whereArgs = new String[] { + id + }; + database.update("nostros_groups", values, whereClause, whereArgs); + } + } + + protected void updateGroup(SQLiteDatabase database) throws JSONException { + JSONObject groupContent = new JSONObject(content); + JSONArray eTags = filterTags("e"); + String groupId = eTags.getJSONArray(0).getString(1); + String query = "SELECT created_at, pubkey FROM nostros_groups WHERE id = ?"; + @SuppressLint("Recycle") Cursor cursor = database.rawQuery(query, new String[] {groupId}); + + ContentValues values = new ContentValues(); values.put("name", groupContent.optString("name")); values.put("about", groupContent.optString("about")); values.put("picture", groupContent.optString("picture")); - database.insert("nostros_groups", null, values); + + if (cursor.getCount() == 0) { + values.put("id", groupId); + values.put("content", content); + values.put("created_at", created_at); + values.put("kind", kind); + values.put("pubkey", pubkey); + values.put("sig", sig); + values.put("tags", tags.toString()); + database.insert("nostros_groups", null, values); + } else if (cursor.moveToFirst() && created_at > cursor.getInt(0) && pubkey.equals(cursor.getString(1))) { + String whereClause = "id = ?"; + String[] whereArgs = new String[] { + groupId + }; + database.update("nostros_groups", values, whereClause, whereArgs); + } } protected void saveGroupMessage(SQLiteDatabase database) throws JSONException { diff --git a/frontend/Components/NoteCard/index.tsx b/frontend/Components/NoteCard/index.tsx index 0af1cb9..9cc1a51 100644 --- a/frontend/Components/NoteCard/index.tsx +++ b/frontend/Components/NoteCard/index.tsx @@ -27,14 +27,13 @@ import { Text, useTheme, Avatar, - IconButton, TouchableRipple, Chip, Surface, } from 'react-native-paper' import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons' import { REGEX_SOCKET_LINK } from '../../Constants/Relay' -import { push } from '../../lib/Navigation' +import { navigate, push } from '../../lib/Navigation' import { Kind } from 'nostr-tools' import ProfileData from '../ProfileData' import { relayToColor } from '../../Functions/NativeFunctions' @@ -141,7 +140,7 @@ export const NoteCard: React.FC = ({ const textNote: () => JSX.Element = () => { return ( <> - {note?.reply_event_id && showAnswerData && ( + {note?.reply_event_id && !note.repost_id && showAnswerData && ( note.kind !== Kind.RecommendRelay && push('Note', { noteId: note.reply_event_id }) @@ -150,15 +149,11 @@ export const NoteCard: React.FC = ({ - - {note.repost_id - ? t('noteCard.reposting', { pubkey: formatPubKey(note.pubkey) }) - : t('noteCard.answering', { pubkey: formatPubKey(note.pubkey) })} - + {t('noteCard.answering', { pubkey: formatPubKey(note.pubkey) })} {t('noteCard.seeParent')} @@ -179,13 +174,42 @@ export const NoteCard: React.FC = ({ numberOfLines={numberOfLines} /> )} - {showRepostPreview && repost && ( - + {note?.repost_id && ( + <> + {repost && showRepostPreview ? ( + + ) : ( + 5 ? 16 : -16, + }} + onPress={() => navigate('Note', { noteId: note.repost_id })} + > + ( + + )} + style={{ + backgroundColor: theme.colors.secondaryContainer, + color: theme.colors.onTertiaryContainer, + }} + > + + {t('noteCard.reposted')} + + + + )} + )} @@ -351,18 +375,9 @@ export const NoteCard: React.FC = ({ lud06={note?.lnurl} picture={showAvatarImage ? note?.picture : undefined} timestamp={note?.created_at} - avatarSize={56} + avatarSize={40} /> - {showAction && ( - - setDisplayUserDrawer(note.pubkey)} - /> - - )} {getNoteContent()} {showAction && ( @@ -471,9 +486,8 @@ const styles = StyleSheet.create({ }, title: { flexDirection: 'row', - justifyContent: 'space-between', - alignContent: 'center', paddingBottom: 16, + flex: 1, }, userBlockedWrapper: { flexDirection: 'row', diff --git a/frontend/Components/ProfileData/index.tsx b/frontend/Components/ProfileData/index.tsx index d863941..3cdaba9 100644 --- a/frontend/Components/ProfileData/index.tsx +++ b/frontend/Components/ProfileData/index.tsx @@ -38,39 +38,61 @@ export const ProfileData: React.FC = ({ return ( - - - - - {usernamePubKey(username, nPub)} - - {validNip05 ? ( - - ) : ( - <> - )} + + + + + + {usernamePubKey(username, nPub)} + + {validNip05 ? ( + + ) : ( + <> + )} + + {validNip05 ? getNip05Domain(nip05) : ''} + + + + + {date ?? ''} - {validNip05 ? getNip05Domain(nip05) : ''} - {date ?? ''} ) } const styles = StyleSheet.create({ + right: { + flexDirection: 'row', + width: '50%', + justifyContent: 'flex-end' + }, + left: { + flexDirection: 'row', + width: '50%' + }, container: { flexDirection: 'row', + justifyContent: 'space-between', + flex: 1 }, contactName: { flexDirection: 'row', }, contactData: { flexDirection: 'column', - justifyContent: 'center', marginLeft: 12, }, verifyIcon: { diff --git a/frontend/Components/TextContent/index.tsx b/frontend/Components/TextContent/index.tsx index d8537f2..1a7cb80 100644 --- a/frontend/Components/TextContent/index.tsx +++ b/frontend/Components/TextContent/index.tsx @@ -152,7 +152,40 @@ export const TextContent: React.FC = ({ return matchingString } - const generatePreview: () => JSX.Element = () => { + const parsedText = React.useMemo(() => ( + Clipboard.setString(text)} + numberOfLines={numberOfLines} + > + {text} + + ), [loadedUsers]) + + const preview = React.useMemo(() => { if (!showPreview) return <> const getRequireCover: () => string | undefined = () => { @@ -233,41 +266,12 @@ export const TextContent: React.FC = ({ {invoice && } ) - } + }, [invoice, url, linkType]) return ( - Clipboard.setString(text)} - numberOfLines={numberOfLines} - > - {text} - - {generatePreview()} + {parsedText} + {preview} ) } diff --git a/frontend/Pages/ConversationPage/index.tsx b/frontend/Pages/ConversationPage/index.tsx index 4c19988..5d93105 100644 --- a/frontend/Pages/ConversationPage/index.tsx +++ b/frontend/Pages/ConversationPage/index.tsx @@ -1,5 +1,5 @@ import React, { useContext, useEffect, useMemo, useRef, useState } from 'react' -import { NativeScrollEvent, NativeSyntheticEvent, ScrollView, StyleSheet, View } from 'react-native' +import { FlatList, ListRenderItem, NativeScrollEvent, NativeSyntheticEvent, ScrollView, StyleSheet, View } from 'react-native' import { AppContext } from '../../Contexts/AppContext' import { RelayPoolContext } from '../../Contexts/RelayPoolContext' import { Event } from '../../lib/nostr/Events' @@ -21,7 +21,6 @@ import { useFocusEffect } from '@react-navigation/native' import { Kind } from 'nostr-tools' import { handleInfinityScroll } from '../../Functions/NativeFunctions' import NostrosAvatar from '../../Components/NostrosAvatar' -import { FlashList, ListRenderItem } from '@shopify/flash-list' import UploadImage from '../../Components/UploadImage' interface ConversationPageProps { @@ -102,7 +101,7 @@ export const ConversationPage: React.FC = ({ route }) => const subscribeDirectMessages: (lastCreateAt?: number) => void = async (lastCreateAt) => { if (publicKey && otherPubKey) { - relayPool?.subscribe(`conversation${route.params.pubKey}`, [ + relayPool?.subscribe(`conversation${route.params.pubKey.substring(0,8)}`, [ { kinds: [Kind.EncryptedDirectMessage], authors: [publicKey], @@ -145,7 +144,7 @@ export const ConversationPage: React.FC = ({ route }) => const directMessage = event as DirectMessage directMessage.pending = true - directMessage.valid_nip05 = validNip05 + directMessage.valid_nip05 = validNip05 ?? false setSendingMessages((prev) => [...prev, directMessage]) setInput('') } @@ -238,8 +237,8 @@ export const ConversationPage: React.FC = ({ route }) => return ( - = ({ route }) => } const styles = StyleSheet.create({ + list: { + scaleY: -1 + }, scrollView: { paddingBottom: 16, }, messageRow: { flexDirection: 'row', justifyContent: 'space-between', + scaleY: -1 }, cardContentDate: { flexDirection: 'row', diff --git a/frontend/Pages/GlobalFeed/index.tsx b/frontend/Pages/GlobalFeed/index.tsx index 35a3b8a..c4c3880 100644 --- a/frontend/Pages/GlobalFeed/index.tsx +++ b/frontend/Pages/GlobalFeed/index.tsx @@ -111,20 +111,16 @@ export const GlobalFeed: React.FC = ({ navigation }) => { setRefreshing(false) if (results.length > 0) { setNotes(results) - const repostIds = notes.filter((note) => note.repost_id).map((note) => note.id ?? '') - const message: RelayFilters[] = [ - { - kinds: [Kind.Metadata], - authors: results.map((note) => note.pubkey ?? ''), - }, - ] + const repostIds = notes.filter((note) => note.repost_id).map((note) => note.repost_id ?? '') if (repostIds.length > 0) { - message.push({ - kinds: [Kind.Text], - '#e': repostIds, - }) + const message: RelayFilters[] = [ + { + kinds: [Kind.Text], + ids: repostIds, + }, + ] + relayPool?.subscribe('homepage-global-meta-repost', message) } - relayPool?.subscribe('homepage-global-meta-repost', message) } }) } diff --git a/frontend/Pages/GroupPage/index.tsx b/frontend/Pages/GroupPage/index.tsx index f9ad5af..942d427 100644 --- a/frontend/Pages/GroupPage/index.tsx +++ b/frontend/Pages/GroupPage/index.tsx @@ -1,5 +1,12 @@ -import React, { useContext, useEffect, useMemo, useRef, useState } from 'react' -import { NativeScrollEvent, NativeSyntheticEvent, ScrollView, StyleSheet, View } from 'react-native' +import React, { useContext, useEffect, useMemo, useState } from 'react' +import { + FlatList, + ListRenderItem, + NativeScrollEvent, + NativeSyntheticEvent, + StyleSheet, + View, +} from 'react-native' import { AppContext } from '../../Contexts/AppContext' import { RelayPoolContext } from '../../Contexts/RelayPoolContext' import { Event } from '../../lib/nostr/Events' @@ -7,14 +14,20 @@ import { useTranslation } from 'react-i18next' import { username, usernamePubKey } from '../../Functions/RelayFunctions/Users' import { getUnixTime, formatDistance, fromUnixTime } from 'date-fns' import TextContent from '../../Components/TextContent' -import { Card, useTheme, TextInput, TouchableRipple, Text } from 'react-native-paper' +import { + Card, + useTheme, + TextInput, + TouchableRipple, + Text, + ActivityIndicator, +} from 'react-native-paper' import { UserContext } from '../../Contexts/UserContext' import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons' import { useFocusEffect } from '@react-navigation/native' import { Kind } from 'nostr-tools' import { handleInfinityScroll } from '../../Functions/NativeFunctions' import NostrosAvatar from '../../Components/NostrosAvatar' -import { FlashList, ListRenderItem } from '@shopify/flash-list' import UploadImage from '../../Components/UploadImage' import { getGroupMessages, GroupMessage } from '../../Functions/DatabaseFunctions/Groups' import { RelayFilters } from '../../lib/nostr/RelayPool/intex' @@ -26,7 +39,6 @@ interface GroupPageProps { export const GroupPage: React.FC = ({ route }) => { const initialPageSize = 10 const theme = useTheme() - const scrollViewRef = useRef() const { database, setDisplayUserDrawer } = useContext(AppContext) const { relayPool, lastEventId } = useContext(RelayPoolContext) const { publicKey, privateKey, name, picture, validNip05 } = useContext(UserContext) @@ -50,7 +62,7 @@ export const GroupPage: React.FC = ({ route }) => { useEffect(() => { loadGroupMessages(false) - }, [lastEventId]) + }, [lastEventId, pageSize]) const loadGroupMessages: (subscribe: boolean) => void = (subscribe) => { if (database && publicKey && privateKey && route.params.groupId) { @@ -64,9 +76,9 @@ export const GroupPage: React.FC = ({ route }) => { const pubKeys = results .map((message) => message.pubkey) .filter((key, index, array) => array.indexOf(key) === index) - const lastCreateAt = pageSize <= results.length ? results[0].created_at : 0 - if (subscribe) subscribeGroupMessages(lastCreateAt, pubKeys) - } else if (subscribe) { + const lastCreateAt = results.length < pageSize ? 0 : results[0].created_at + subscribeGroupMessages(lastCreateAt, pubKeys) + } else { subscribeGroupMessages() } }) @@ -102,7 +114,7 @@ export const GroupPage: React.FC = ({ route }) => { }) } - relayPool?.subscribe(`group${route.params.groupId}`, filters) + relayPool?.subscribe(`group${route.params.groupId.substring(0, 8)}`, filters) } } @@ -131,10 +143,10 @@ export const GroupPage: React.FC = ({ route }) => { item.pubkey === publicKey ? usernamePubKey(name, publicKey) : username({ name: item.name, id: item.pubkey }) - const showAvatar = groupMessages[index - 1]?.pubkey !== item.pubkey + const showAvatar = [...groupMessages, ...sendingMessages][index - 1]?.pubkey !== item.pubkey return ( - + {publicKey !== item.pubkey && ( {showAvatar && ( @@ -212,14 +224,20 @@ export const GroupPage: React.FC = ({ route }) => { return ( - 0 ? ( + + ) : ( + <> + ) + } /> = ({ route }) => { label={t('groupPage.typeMessage') ?? ''} value={input} onChangeText={setInput} - onFocus={() => scrollViewRef.current?.scrollToEnd({ animated: true })} left={ ( @@ -276,12 +293,16 @@ export const GroupPage: React.FC = ({ route }) => { } const styles = StyleSheet.create({ + list: { + scaleY: -1 + }, scrollView: { paddingBottom: 16, }, messageRow: { flexDirection: 'row', justifyContent: 'space-between', + scaleY: -1 }, cardContentDate: { flexDirection: 'row', @@ -291,7 +312,7 @@ const styles = StyleSheet.create({ paddingBottom: 16, paddingRight: 16, justifyContent: 'space-between', - flex: 1, + flex: 1 }, card: { marginTop: 16, @@ -324,6 +345,9 @@ const styles = StyleSheet.create({ flexDirection: 'column-reverse', marginTop: 16, }, + loading: { + paddingTop: 16, + }, snackbar: { margin: 16, bottom: 70, diff --git a/frontend/Pages/GroupsFeed/index.tsx b/frontend/Pages/GroupsFeed/index.tsx index 4200574..67b5f97 100644 --- a/frontend/Pages/GroupsFeed/index.tsx +++ b/frontend/Pages/GroupsFeed/index.tsx @@ -73,25 +73,19 @@ export const GroupsFeed: React.FC = () => { const filters: RelayFilters[] = [ { kinds: [Kind.ChannelCreation], - authors: [publicKey], + authors: [publicKey, newGroupId ?? ''], }, ] - if (results && results.length > 0) { + filters.push({ + kinds: [Kind.ChannelMetadata], + ids: [...results.map((group) => group.id ?? ''), publicKey, newGroupId ?? ''], + }) + if (results.length > 0) { setGroups(results) filters.push({ kinds: [Kind.Metadata], ids: [...results.map((group) => group.pubkey)], }) - filters.push({ - kinds: [Kind.ChannelMetadata], - ids: [...results.map((group) => group.id ?? ''), publicKey, newGroupId ?? ''], - }) - if (newGroupId) { - filters.push({ - kinds: [Kind.ChannelCreation], - ids: [newGroupId], - }) - } } relayPool?.subscribe('groups-create', filters) }) @@ -157,13 +151,13 @@ export const GroupsFeed: React.FC = () => { {username({ name: item.user_name, id: item.pubkey })} - {item.valid_nip05 && ( + {item.valid_nip05 ? ( - )} + ) : <>} {formatId(item.id)} @@ -246,7 +240,6 @@ export const GroupsFeed: React.FC = () => { return ( = ({ navigation }) => { since: lastReply?.created_at ?? 0, }, ]) - - const repostIds = notes.filter((note) => note.repost_id).map((note) => note.id ?? '') + const repostIds = notes.filter((note) => note.repost_id).map((note) => note.repost_id ?? '') if (repostIds.length > 0) { relayPool?.subscribe('homepage-contacts-repost', [ { kinds: [Kind.Text], - '#e': repostIds, + ids: repostIds, }, ]) } diff --git a/frontend/Pages/NotePage/index.tsx b/frontend/Pages/NotePage/index.tsx index f06332f..610274c 100644 --- a/frontend/Pages/NotePage/index.tsx +++ b/frontend/Pages/NotePage/index.tsx @@ -13,6 +13,7 @@ import { navigate } from '../../lib/Navigation' import { useFocusEffect } from '@react-navigation/native' import { SkeletonNote } from '../../Components/SkeletonNote/SkeletonNote' import { ScrollView } from 'react-native-gesture-handler' +import { RelayFilters } from '../../lib/nostr/RelayPool/intex' interface NotePageProps { route: { params: { noteId: string } } @@ -54,12 +55,19 @@ export const NotePage: React.FC = ({ route }) => { const notes = await getNotes(database, { filters: { reply_event_id: route.params.noteId } }) const rootReplies = getDirectReplies(event, notes) - relayPool?.subscribe(`meta-notepage${route.params.noteId}`, [ + const filters: RelayFilters[] = [ { kinds: [Kind.Metadata], authors: [...rootReplies.map((note) => note.pubkey), event.pubkey], }, - ]) + ] + if (event.repost_id) { + filters.push({ + kinds: [Kind.Text], + ids: [event.repost_id], + }) + } + relayPool?.subscribe(`meta-notepage${route.params.noteId.substring(0,8)}`, filters) setReplies(rootReplies as Note[]) } setRefreshing(false) @@ -74,13 +82,13 @@ export const NotePage: React.FC = ({ route }) => { const subscribeNotes: (past?: boolean) => Promise = async (past) => { if (database && route.params.noteId) { - relayPool?.subscribe(`notepage${route.params.noteId}`, [ + relayPool?.subscribe(`notepage${route.params.noteId.substring(0,8)}`, [ { kinds: [Kind.Text], ids: [route.params.noteId], }, ]) - relayPool?.subscribe(`notepage-replies-${route.params.noteId}`, [ + relayPool?.subscribe(`notepage-replies-${route.params.noteId.substring(0,8)}`, [ { kinds: [Kind.Reaction, Kind.Text, Kind.RecommendRelay], '#e': [route.params.noteId], diff --git a/frontend/Pages/ProfilePage/index.tsx b/frontend/Pages/ProfilePage/index.tsx index 84e3fdf..b653638 100644 --- a/frontend/Pages/ProfilePage/index.tsx +++ b/frontend/Pages/ProfilePage/index.tsx @@ -96,7 +96,7 @@ export const ProfilePage: React.FC = ({ route }) => { setNotes(results) setRefreshing(false) if (results.length > 0) { - relayPool?.subscribe(`profile-answers${route.params.pubKey}`, [ + relayPool?.subscribe(`profile-answers${route.params.pubKey.substring(0,8)}`, [ { kinds: [Kind.Reaction, Kind.Text, Kind.RecommendRelay], '#e': results.map((note) => note.id ?? ''), @@ -109,7 +109,7 @@ export const ProfilePage: React.FC = ({ route }) => { } const subscribeProfile: () => Promise = async () => { - relayPool?.subscribe(`profile-user${route.params.pubKey}`, [ + relayPool?.subscribe(`profile-user${route.params.pubKey.substring(0,8)}`, [ { kinds: [Kind.Metadata, Kind.Contacts], authors: [route.params.pubKey], @@ -125,7 +125,7 @@ export const ProfilePage: React.FC = ({ route }) => { authors: [route.params.pubKey], limit: pageSize, } - relayPool?.subscribe(`profile${route.params.pubKey}`, [message]) + relayPool?.subscribe(`profile${route.params.pubKey.substring(0,8)}`, [message]) } const onScroll: (event: NativeSyntheticEvent) => void = (event) => { diff --git a/frontend/Pages/ReactionsFeed/index.tsx b/frontend/Pages/ReactionsFeed/index.tsx index 7548bf5..d2d0cc8 100644 --- a/frontend/Pages/ReactionsFeed/index.tsx +++ b/frontend/Pages/ReactionsFeed/index.tsx @@ -129,12 +129,12 @@ export const ReactionsFeed: React.FC = ({ navigation }) => { }, ]) - const repostIds = notes.filter((note) => note.repost_id).map((note) => note.id ?? '') + const repostIds = notes.filter((note) => note.repost_id).map((note) => note.repost_id ?? '') if (repostIds.length > 0) { relayPool?.subscribe('homepage-contacts-repost', [ { kinds: [Kind.Text], - '#e': repostIds, + ids: repostIds, }, ]) } diff --git a/frontend/Pages/RepostsFeed/index.tsx b/frontend/Pages/RepostsFeed/index.tsx index 6eff9ab..b16ee6d 100644 --- a/frontend/Pages/RepostsFeed/index.tsx +++ b/frontend/Pages/RepostsFeed/index.tsx @@ -106,7 +106,6 @@ export const RepostsFeed: React.FC = ({ navigation }) => { authors: notes.map((note) => note.pubkey ?? ''), }, ]) - const lastReaction = await getLastReaction(database, { eventIds: notes.map((note) => note.id ?? ''), }) @@ -128,13 +127,12 @@ export const RepostsFeed: React.FC = ({ navigation }) => { since: lastReply?.created_at ?? 0, }, ]) - - const repostIds = notes.filter((note) => note.repost_id).map((note) => note.id ?? '') + const repostIds = notes.filter((note) => note.repost_id).map((note) => note.repost_id ?? '') if (repostIds.length > 0) { relayPool?.subscribe('homepage-contacts-repost', [ { kinds: [Kind.Text], - '#e': repostIds, + ids: repostIds, }, ]) } diff --git a/index.js b/index.js index cbef63e..6b6f8ce 100644 --- a/index.js +++ b/index.js @@ -6,4 +6,8 @@ import { AppRegistry } from 'react-native' import App from './App' import { name as appName } from './app.json' +// FIXME: https://github.com/facebook/react-native/issues/30034#issuecomment-1277360480 +import ViewReactNativeStyleAttributes from 'react-native/Libraries/Components/View/ReactNativeStyleAttributes' +ViewReactNativeStyleAttributes.scaleY = true + AppRegistry.registerComponent(appName, () => App)