From 68300a9b745c839eee53d2b6ebd958937105bdac Mon Sep 17 00:00:00 2001 From: KoalaSat Date: Sun, 26 Feb 2023 20:20:03 +0100 Subject: [PATCH] Other inputs --- frontend/Pages/ContactsPage/index.tsx | 2 +- frontend/Pages/ConversationsFeed/index.tsx | 20 +++++++++++++++++++- frontend/Pages/GroupsFeed/index.tsx | 21 ++++++++++++++++++++- frontend/Pages/ProfileConnectPage/index.tsx | 2 +- frontend/Pages/QrReaderPage/index.tsx | 6 +----- 5 files changed, 42 insertions(+), 9 deletions(-) diff --git a/frontend/Pages/ContactsPage/index.tsx b/frontend/Pages/ContactsPage/index.tsx index ad24fc0..703592b 100644 --- a/frontend/Pages/ContactsPage/index.tsx +++ b/frontend/Pages/ContactsPage/index.tsx @@ -470,7 +470,7 @@ export const ContactsPage: React.FC = () => { icon='qrcode' onPress={() => { bottomSheetAddContactRef.current?.close() - navigate('QrReader', { callback: 'Contacts' }) + navigate('QrReader') }} forceTextInputFocus={false} /> diff --git a/frontend/Pages/ConversationsFeed/index.tsx b/frontend/Pages/ConversationsFeed/index.tsx index 7b6b121..ae1b6c2 100644 --- a/frontend/Pages/ConversationsFeed/index.tsx +++ b/frontend/Pages/ConversationsFeed/index.tsx @@ -44,7 +44,7 @@ export const ConversationsFeed: React.FC = () => { const initialPageSize = 14 const theme = useTheme() const { t } = useTranslation('common') - const { database, refreshBottomBarAt } = useContext(AppContext) + const { database, refreshBottomBarAt, qrReader, setQrReader } = useContext(AppContext) const [pageSize, setPageSize] = useState(initialPageSize) const { publicKey, privateKey } = useContext(UserContext) const { relayPool, lastEventId } = useContext(RelayPoolContext) @@ -72,6 +72,13 @@ export const ConversationsFeed: React.FC = () => { loadDirectMessages(false) }, [lastEventId, refreshBottomBarAt]) + useEffect(() => { + if (qrReader) { + setQrReader(undefined) + navigate('Conversation', { pubKey: qrReader, title: qrReader }) + } + }, [qrReader]) + const loadDirectMessages: (subscribe: boolean) => void = (subscribe) => { if (database && publicKey) { getGroupedDirectMessages(database, { limit: pageSize }).then((results) => { @@ -329,6 +336,17 @@ export const ConversationsFeed: React.FC = () => { forceTextInputFocus={false} /> } + left={ + { + bottomSheetCreateRef.current?.close() + bottomSheetPubKeyRef.current?.close() + navigate('QrReader') + }} + forceTextInputFocus={false} + /> + } />