Skip to content

Commit

Permalink
Longer reports + bug where convo screen isn't popped upon report (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
duogenesis authored Dec 31, 2023
1 parent dbb0fd7 commit c59101c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
15 changes: 7 additions & 8 deletions components/conversation-screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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))}`
),
};

Expand All @@ -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,
Expand Down Expand Up @@ -375,6 +368,12 @@ const ConversationScreen = ({navigation, route}) => {
setShowMenu(x => !x);
}, []);

useEffect(() => {
return listen(`skip-profile-${personId}`, () => {
navigation.popToTop();
});
}, [navigation, personId]);

return (
<>
<TopNavBar>
Expand Down
4 changes: 1 addition & 3 deletions components/inbox-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion components/report-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit c59101c

Please sign in to comment.