Skip to content

Commit

Permalink
Merge pull request Expensify#25426 from Expensify/marcaaron-reapply-o…
Browse files Browse the repository at this point in the history
…nyx-upgrade-use-cache-with-fixes

Bump Onyx to 1.0.61
  • Loading branch information
mountiny authored Aug 18, 2023
2 parents 7cbd602 + 005aa4d commit 4de6fd7
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 29 deletions.
16 changes: 7 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
"react-native-linear-gradient": "^2.8.1",
"react-native-localize": "^2.2.6",
"react-native-modal": "^13.0.0",
"react-native-onyx": "1.0.52",
"react-native-onyx": "1.0.61",
"react-native-pager-view": "^6.2.0",
"react-native-pdf": "^6.6.2",
"react-native-performance": "^4.0.0",
Expand Down
6 changes: 1 addition & 5 deletions src/components/EmojiPicker/EmojiPicker.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, {useState, useEffect, useRef, forwardRef, useImperativeHandle} from 'react';
import {Dimensions, Keyboard} from 'react-native';
import {Dimensions} from 'react-native';
import _ from 'underscore';
import EmojiPickerMenu from './EmojiPickerMenu';
import CONST from '../../CONST';
Expand Down Expand Up @@ -119,10 +119,6 @@ const EmojiPicker = forwardRef((props, ref) => {
useImperativeHandle(ref, () => ({showEmojiPicker, isActiveReportAction, hideEmojiPicker, isEmojiPickerVisible, resetEmojiPopoverAnchor}));

useEffect(() => {
if (isEmojiPickerVisible) {
Keyboard.dismiss();
}

const emojiPopoverDimensionListener = Dimensions.addEventListener('change', () => {
if (!emojiPopoverAnchor.current) {
// In small screen width, the window size change might be due to keyboard open/hide, we should avoid hide EmojiPicker in those cases
Expand Down
1 change: 0 additions & 1 deletion src/components/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ const defaultProps = {
isSubmitButtonVisible: true,
formState: {
isLoading: false,
errors: null,
},
draftValues: {},
enabledWhenOffline: false,
Expand Down
14 changes: 2 additions & 12 deletions src/components/OptionsSelector/BaseOptionsSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,6 @@ class BaseOptionsSelector extends Component {
);

this.scrollToIndex(this.props.selectedOptions.length ? 0 : this.state.focusedIndex, false);

if (!this.props.autoFocus) {
return;
}

if (this.props.shouldShowTextInput) {
if (this.props.shouldDelayFocus) {
this.focusTimeout = setTimeout(() => this.textInput.focus(), CONST.ANIMATED_TRANSITION);
} else {
this.textInput.focus();
}
}
}

componentDidUpdate(prevProps) {
Expand Down Expand Up @@ -339,6 +327,8 @@ class BaseOptionsSelector extends Component {
selectTextOnFocus
blurOnSubmit={Boolean(this.state.allOptions.length)}
spellCheck={false}
autoFocus={this.props.autoFocus}
shouldDelayFocus={this.props.shouldDelayFocus}
/>
);
const optionsList = (
Expand Down
1 change: 1 addition & 0 deletions src/libs/actions/IOU.js
Original file line number Diff line number Diff line change
Expand Up @@ -1737,6 +1737,7 @@ function createEmptyTransaction() {
function navigateToNextPage(iou, iouType, reportID, report) {
const moneyRequestID = `${iouType}${reportID}`;
const shouldReset = iou.id !== moneyRequestID;

// If the money request ID in Onyx does not match the ID from params, we want to start a new request
// with the ID from params. We need to clear the participants in case the new request is initiated from FAB.
if (shouldReset) {
Expand Down
2 changes: 1 addition & 1 deletion src/libs/actions/QueuedOnyxUpdates.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Onyx.connect({
* @returns {Promise}
*/
function queueOnyxUpdates(updates) {
return Onyx.merge(ONYXKEYS.QUEUED_ONYX_UPDATES, updates);
return Onyx.set(ONYXKEYS.QUEUED_ONYX_UPDATES, [...queuedOnyxUpdates, ...updates]);
}

function clear() {
Expand Down

0 comments on commit 4de6fd7

Please sign in to comment.