Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/js/actions/VoterActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,21 @@ export default {

updateReviewedAppFields (
appReviewState,
addressStateCode,
appReviewVersion,
appReviewPlatform,
appReviewPathname,
appReviewBodyNegativeBypass,
appReviewEmail,
) {
Dispatcher.loadEndpoint(
'voterReviewedApp',
{
app_review_state: appReviewState,
address_state_code: addressStateCode,
app_review_version: appReviewVersion,
app_review_platform: appReviewPlatform,
app_review_pathname: appReviewPathname,
app_review_body_negative_bypass: appReviewBodyNegativeBypass, // not a database field
app_review_email: appReviewEmail, // not a database field
},
Expand Down
5 changes: 3 additions & 2 deletions src/js/components/ReviewApps/ReviewAppModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import * as React from 'react';
import { useEffect, useRef, useState } from 'react';
import AppObservableStore from '../../common/stores/AppObservableStore';
import { isIOS } from '../../common/utils/cordovaUtils';
import { isAndroid } from '../../common/utils/isCordovaOrWebApp';
import { renderLog } from '../../common/utils/logging';
import { handleNegativeAppReview } from '../../utils/appReviewFunctions';
import { isAndroid } from '../../common/utils/isCordovaOrWebApp';

/* global $ */

Expand Down Expand Up @@ -55,8 +55,9 @@ export default function ReviewAppModal (props) {
const appReviewBodyNegativeBypass = bodyInputRef.current.value;
const okToSend = checkBoxInputRef.current.checked;
const appReviewEmail = okToSend ? emailInputRef.current : '';
const appReviewPathname = window.location.hash;
handleClose();
handleNegativeAppReview(appReviewVersion, appReviewPlatform, appReviewBodyNegativeBypass, appReviewEmail);
handleNegativeAppReview(appReviewVersion, appReviewPlatform, appReviewPathname, appReviewBodyNegativeBypass, appReviewEmail);
};

renderLog('ReviewAppModal'); // Set LOG_RENDER_EVENTS to log all renders
Expand Down
3 changes: 3 additions & 0 deletions src/js/components/SetUpAccount/cordovaContactUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import ContactsX from 'cordova-plugin-contacts-x';

// October 2026 might need to upgrade again to @herdwatch/cordova-plugin-contacts
// https://github.com/herdwatch-apps/cordova-plugin-contacts


const getDeviceContacts = async (callBack) => {
ContactsX.find((deviceContactList) => {
Expand Down
10 changes: 8 additions & 2 deletions src/js/utils/appReviewFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function checkForAppReview (source) {
}

const platforms = ['iOS', 'Android'];
function handleNegativeAppReview (appReviewVersion, appReviewPlatform, appReviewBodyNegativeBypass, appReviewEmail) {
function handleNegativeAppReview (appReviewVersion, appReviewPlatform, appReviewPathname, appReviewBodyNegativeBypass, appReviewEmail) {
if (!platforms.includes(appReviewPlatform)) {
throw new Error(`handleNegativeAppReview received invalid appReviewPlatform ${appReviewPlatform}`);
}
Expand All @@ -54,10 +54,16 @@ function handleNegativeAppReview (appReviewVersion, appReviewPlatform, appReview
throw new Error(`handleNegativeAppReview received invalid reviewEmail ${appReviewEmail}`);
}
AppObservableStore.setAskedVoterToReviewApp(true); // So we only ask once peer session

const appReviewState = 'Negative';
const addressStateCode = VoterStore.getTextForMapSearch() || 'error';

VoterActions.updateReviewedAppFields(
'Negative',
appReviewState,
addressStateCode,
appReviewVersion,
appReviewPlatform,
appReviewPathname,
appReviewBodyNegativeBypass,
appReviewEmail,
);
Expand Down
Loading