From c59101c87b705f63e934298b59a985e6eebfeed3 Mon Sep 17 00:00:00 2001 From: duogenesis <136373989+duogenesis@users.noreply.github.com> Date: Sun, 31 Dec 2023 13:53:38 +1100 Subject: [PATCH] Longer reports + bug where convo screen isn't popped upon report (#163) --- components/conversation-screen.tsx | 15 +++++++-------- components/inbox-item.tsx | 4 +--- components/report-modal.tsx | 2 +- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/components/conversation-screen.tsx b/components/conversation-screen.tsx index f5ec736e..0daa4ba4 100644 --- a/components/conversation-screen.tsx +++ b/components/conversation-screen.tsx @@ -81,8 +81,7 @@ const Menu = ({navigation, name, personId, messages, closeFn}) => { name, personId, context: ( - `Conversation Screen - ` + - `${String(JSON.stringify(messages, null, 2)).slice(0, 900)}` + `Conversation Screen\n${String(JSON.stringify(messages, null, 2))}` ), }; @@ -98,12 +97,6 @@ const Menu = ({navigation, name, personId, messages, closeFn}) => { })(); }, [personId]); - useEffect(() => { - return listen(`skip-profile-${personId}`, () => { - navigation.popToTop(); - }); - }, [navigation, personId]); - const pressableStyle: ViewStyle = { flexDirection: 'row', gap: 10, @@ -375,6 +368,12 @@ const ConversationScreen = ({navigation, route}) => { setShowMenu(x => !x); }, []); + useEffect(() => { + return listen(`skip-profile-${personId}`, () => { + navigation.popToTop(); + }); + }, [navigation, personId]); + return ( <> diff --git a/components/inbox-item.tsx b/components/inbox-item.tsx index d0607f9c..89b2858d 100644 --- a/components/inbox-item.tsx +++ b/components/inbox-item.tsx @@ -103,9 +103,7 @@ const IntrosItem = ({ const data: ReportModalInitialData = { name, personId, - context: ( - `Inbox Item - ${JSON.stringify(contextData).slice(0, 900)}` - ), + context: `Inbox Item\n${JSON.stringify(contextData)}`, }; notify('open-report-modal', data); diff --git a/components/report-modal.tsx b/components/report-modal.tsx index 92e3fd87..ff529583 100644 --- a/components/report-modal.tsx +++ b/components/report-modal.tsx @@ -56,7 +56,7 @@ const ReportModal = () => { setIsLoading(true); - const completeReportText = `${context} - ${reportText}`; + const completeReportText = `${context.slice(0, 7999)}\n${reportText}`; if (await setSkipped(personId, true, completeReportText)) { setIsVisible(false); } else {