From adaf392b1758a9e5123de6a46b65fa5a359a2521 Mon Sep 17 00:00:00 2001 From: Sebastian Webster Date: Thu, 21 Sep 2023 02:56:24 +1200 Subject: [PATCH] Fixed retrying user report failing --- screens/ReportAccount.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/screens/ReportAccount.js b/screens/ReportAccount.js index e822620..a96073a 100644 --- a/screens/ReportAccount.js +++ b/screens/ReportAccount.js @@ -30,7 +30,9 @@ const ReportAccount = ({navigation, route: routeData}) => { const submitReportOfAccount = (reportType) => { if (storedCredentials) { - setLastReportType(reportType) + if (reportType !== lastReportType) { + setLastReportType(reportType) + } setSendingReport(true) setError(null) axios.post(serverUrl + '/tempRoute/reportUser', {reportType: reportType || lastReportType, reporteePubId: reportedAccountPubId}).then(response => { @@ -50,7 +52,7 @@ const ReportAccount = ({navigation, route: routeData}) => { }).catch(error => { console.log("An error occured while reporting user.") - console.log(error) + console.error(error) setSendingReport(false) setError(ParseErrorMessage(error)) }) @@ -90,7 +92,7 @@ const ReportAccount = ({navigation, route: routeData}) => { : error ? {error} - + submitReportOfAccount(lastReportType)}>