Skip to content

Commit

Permalink
Merge branch 'main' into hold-request/educational-interstitial
Browse files Browse the repository at this point in the history
merge main into hold-request/educational-interstitial
  • Loading branch information
cdOut committed Jan 2, 2024
2 parents af7d570 + a2fc252 commit 2b82415
Show file tree
Hide file tree
Showing 9 changed files with 282 additions and 179 deletions.
4 changes: 2 additions & 2 deletions src/components/AddressSearch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ function AddressSearch({
// amount of data massaging needs to happen for what the parent expects to get from this function.
if (_.size(details)) {
onPress({
address: lodashGet(details, 'description'),
address: autocompleteData.description || lodashGet(details, 'description', ''),
lat: lodashGet(details, 'geometry.location.lat', 0),
lng: lodashGet(details, 'geometry.location.lng', 0),
name: lodashGet(details, 'name'),
Expand Down Expand Up @@ -266,7 +266,7 @@ function AddressSearch({

lat: lodashGet(details, 'geometry.location.lat', 0),
lng: lodashGet(details, 'geometry.location.lng', 0),
address: lodashGet(details, 'formatted_address', ''),
address: autocompleteData.description || lodashGet(details, 'formatted_address', ''),
};

// If the address is not in the US, use the full length state name since we're displaying the address's
Expand Down
388 changes: 237 additions & 151 deletions src/components/TimePicker/TimePicker.js

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions src/components/TimePicker/setCursorPosition/index.ios.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import SetCursorPosition from './types';

const setCursorPosition: SetCursorPosition = (position, ref, setSelection) => {
const selection = {
start: position,
end: position,
};
setSelection(selection);
ref.current?.focus();
ref.current?.setNativeProps({selection});
};

export default setCursorPosition;
11 changes: 11 additions & 0 deletions src/components/TimePicker/setCursorPosition/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import SetCursorPosition from './types';

const setCursorPosition: SetCursorPosition = (position, ref, setSelection) => {
setSelection({
start: position,
end: position,
});
ref.current?.focus();
};

export default setCursorPosition;
6 changes: 6 additions & 0 deletions src/components/TimePicker/setCursorPosition/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import {RefObject} from 'react';
import {TextInput} from 'react-native';

type SetCursorPosition = (position: number, ref: RefObject<TextInput>, setSelection: (value: {start: number; end: number}) => void) => void;

export default SetCursorPosition;
8 changes: 0 additions & 8 deletions src/components/TimePicker/setSelection.ios.ts

This file was deleted.

18 changes: 0 additions & 18 deletions src/components/TimePicker/setSelection.ts

This file was deleted.

5 changes: 5 additions & 0 deletions src/libs/Navigation/AppNavigator/ReportScreenIDSetter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ function ReportScreenIDSetter({route, reports, policies, navigation, isFirstTime
useEffect(() => {
// Don't update if there is a reportID in the params already
if (route?.params?.reportID) {
const reportActionID = route?.params?.reportActionID;
const regexValidReportActionID = new RegExp(/^\d*$/);
if (reportActionID && !regexValidReportActionID.test(reportActionID)) {
navigation.setParams({reportActionID: ''});
}
App.confirmReadyToOpenApp();
return;
}
Expand Down
8 changes: 8 additions & 0 deletions src/libs/actions/Policy.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ function buildAnnounceRoomMembersOnyxData(policyID, accountIDs) {
onyxFailureData: [],
};

if (!announceReport) {
return announceRoomMembers;
}

announceRoomMembers.onyxOptimisticData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${announceReport.reportID}`,
Expand Down Expand Up @@ -301,6 +305,10 @@ function removeOptimisticAnnounceRoomMembers(policyID, accountIDs) {
onyxFailureData: [],
};

if (!announceReport) {
return announceRoomMembers;
}

const remainUsers = _.difference(announceReport.participantAccountIDs, accountIDs);
announceRoomMembers.onyxOptimisticData.push({
onyxMethod: Onyx.METHOD.MERGE,
Expand Down

0 comments on commit 2b82415

Please sign in to comment.