Skip to content

Commit

Permalink
Merge pull request #139 from rainbow-me/layout-x
Browse files Browse the repository at this point in the history
Fix this.layout[o].x errors when importing
  • Loading branch information
jinchung committed Jul 30, 2019
2 parents 20f3935 + b4d6aee commit 0791a69
Show file tree
Hide file tree
Showing 16 changed files with 161 additions and 176 deletions.
1 change: 0 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
}
},
"plugins": [
"babel-plugin-rewire",
"babel-plugin-styled-components",
"date-fns",
[
Expand Down
38 changes: 19 additions & 19 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ PODS:
- DoubleConversion
- glog
- glog (0.3.5)
- GoogleToolboxForMac/Defines (2.2.0)
- GoogleToolboxForMac/Logger (2.2.0):
- GoogleToolboxForMac/Defines (= 2.2.0)
- "GoogleToolboxForMac/NSData+zlib (2.2.0)":
- GoogleToolboxForMac/Defines (= 2.2.0)
- GoogleToolboxForMac/Defines (2.2.1)
- GoogleToolboxForMac/Logger (2.2.1):
- GoogleToolboxForMac/Defines (= 2.2.1)
- "GoogleToolboxForMac/NSData+zlib (2.2.1)":
- GoogleToolboxForMac/Defines (= 2.2.1)
- libwebp (1.0.2):
- libwebp/core (= 1.0.2)
- libwebp/dec (= 1.0.2)
Expand Down Expand Up @@ -69,7 +69,7 @@ PODS:
- nanopb/encode (= 0.3.901)
- nanopb/decode (0.3.901)
- nanopb/encode (0.3.901)
- Protobuf (3.7.0)
- Protobuf (3.9.0)
- React (0.59.9):
- React/Core (= 0.59.9)
- react-native-blur (0.8.0):
Expand Down Expand Up @@ -149,7 +149,7 @@ PODS:
- React
- RNCMaskedView (0.1.1):
- React
- RNDeviceInfo (2.3.0):
- RNDeviceInfo (2.3.1):
- React
- RNIOS11DeviceCheck (0.0.3):
- React
Expand All @@ -161,9 +161,9 @@ PODS:
- React
- RNStoreReview (0.1.5):
- React
- SDWebImage (5.0.2):
- SDWebImage/Core (= 5.0.2)
- SDWebImage/Core (5.0.2)
- SDWebImage (5.0.6):
- SDWebImage/Core (= 5.0.6)
- SDWebImage/Core (5.0.6)
- yoga (0.59.9.React)

DEPENDENCIES:
Expand Down Expand Up @@ -279,18 +279,18 @@ SPEC CHECKSUMS:
Crashlytics: 55e24fc23989680285a21cb1146578d9d18e432c
DoubleConversion: bb338842f62ab1d708ceb63ec3d999f0f3d98ecd
Fabric: 25d0963b691fc97be566392243ff0ecef5a68338
Firebase: 76ec2a7cde90fb4037793f83aeeca48451543487
FirebaseAnalytics: b8bce8d5c40173328b8a4300da18c5c7e0a1908d
FirebaseCore: 31d258ec80ea97e1e8e40ce00a7ba7297afb45c2
FirebaseInstanceID: 4f7768a98c5c3c5bd9a4c9e431ea98dccc0a51f9
FirebaseMessaging: 94579ae655d817287f029ebfebd5b0811fbb3a51
Firebase: 68afeeb05461db02d7c9e3215cda28068670f4aa
FirebaseAnalytics: b3628aea54c50464c32c393fb2ea032566e7ecc2
FirebaseCore: 62f1b792a49bb9e8b4073f24606d2c93ffc352f0
FirebaseInstanceID: f3f0657372592ecdfdfe2cac604a5a75758376a6
FirebaseMessaging: 6894b8fe0a0cf26c3b13dad729f1131654ae0bdb
FLAnimatedImage: 4a0b56255d9b05f18b6dd7ee06871be5d3b89e31
Folly: de497beb10f102453a1afa9edbf8cf8a251890de
glog: aefd1eb5dda2ab95ba0938556f34b98e2da3a60d
GoogleToolboxForMac: ff31605b7d66400dcec09bed5861689aebadda4d
GoogleToolboxForMac: b3553629623a3b1bff17f555e736cd5a6d95ad55
libwebp: b068a3bd7c45f7460f6715be7bed1a18fd5d6b48
nanopb: 2901f78ea1b7b4015c860c2fdd1ea2fee1a18d48
Protobuf: 7a877b7f3e5964e3fce995e2eb323dbc6831bb5a
Protobuf: 1097ca58584c8d9be81bfbf2c5ff5975648dd87a
React: a86b92f00edbe1873a63e4a212c29b7a7ad5224f
react-native-blur: cad4d93b364f91e7b7931b3fa935455487e5c33c
react-native-camera: f1fbfc336ba8ca6de5296190341d1b6022c71cff
Expand All @@ -300,13 +300,13 @@ SPEC CHECKSUMS:
RNAnalytics: d110195618296fed3907830911f01cb6e9be53d0
RNCAsyncStorage: 9436928b444c5f5361960a7eea051a697c244b68
RNCMaskedView: b79e193409a90bf6b5170d421684f437ff4e2278
RNDeviceInfo: 65106cc87ad6f6f71ef2ecc667f4c59b840888e2
RNDeviceInfo: 74ee98a0b3ef57604ea9953f03eca549a9335160
RNIOS11DeviceCheck: a4a545fdd08230a17a8ce7608e95038ee23a32aa
RNLanguages: 962e562af0d34ab1958d89bcfdb64fafc37c513e
RNReanimated: 7a52c90473b5e81c13408d40d797b98387eaddde
RNScreens: f28b48b8345f2f5f39ed6195518291515032a788
RNStoreReview: 62d6afd7c37db711a594bbffca6b0ea3a812b7a8
SDWebImage: 6764b5fa0f73c203728052955dbefa2bf1f33282
SDWebImage: 920f1a2ff1ca8296ad34f6e0510a1ef1d70ac965
yoga: 03ff42a6f223fb88deeaed60249020d80c3091ee

PODFILE CHECKSUM: 9a1477d30332ab86b10fd2ec7e7842ad52b5382e
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -236,4 +236,4 @@
"vm": "vm-browserify",
"tls": false
}
}
}
36 changes: 36 additions & 0 deletions patches/recyclerlistview+2.0.1-alpha.1.patch
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,42 @@ index 26e19af..e2a2913 100644
};
ViewabilityTracker.prototype.forceRefreshWithOffset = function (offset) {
this._currentOffset = -1;
diff --git a/node_modules/recyclerlistview/dist/reactnative/core/StickyContainer.js b/node_modules/recyclerlistview/dist/reactnative/core/StickyContainer.js
index e3af431..8de1ec4 100644
--- a/node_modules/recyclerlistview/dist/reactnative/core/StickyContainer.js
+++ b/node_modules/recyclerlistview/dist/reactnative/core/StickyContainer.js
@@ -54,14 +54,14 @@ var StickyContainer = /** @class */ (function (_super) {
}
};
_this._getStickyHeaderRef = function (stickyHeaderRef) {
- if (!_this._stickyHeaderRef) {
+ if (_this._stickyHeaderRef !== stickyHeaderRef) {
_this._stickyHeaderRef = stickyHeaderRef;
// TODO: Resetting state once ref is initialized. Can look for better solution.
_this._callStickyObjectsOnVisibleIndicesChanged(_this._visibleIndicesAll);
}
};
_this._getStickyFooterRef = function (stickyFooterRef) {
- if (!_this._stickyFooterRef) {
+ if (_this._stickyFooterRef !== stickyFooterRef) {
_this._stickyFooterRef = stickyFooterRef;
// TODO: Resetting state once ref is initialized. Can look for better solution.
_this._callStickyObjectsOnVisibleIndicesChanged(_this._visibleIndicesAll);
diff --git a/node_modules/recyclerlistview/dist/reactnative/core/layoutmanager/LayoutManager.js b/node_modules/recyclerlistview/dist/reactnative/core/layoutmanager/LayoutManager.js
index 3851852..23075a0 100644
--- a/node_modules/recyclerlistview/dist/reactnative/core/layoutmanager/LayoutManager.js
+++ b/node_modules/recyclerlistview/dist/reactnative/core/layoutmanager/LayoutManager.js
@@ -172,6 +172,10 @@ var WrapGridLayoutManager = /** @class */ (function (_super) {
}
var i = startIndex - 1;
for (; i >= 0; i--) {
+ if (!this._layouts[i]) {
+ console.warn("WrapGridLayoutManager layout at index", i, "does not exist"); //tslint:disable-line
+ continue;
+ }
if (this._isHorizontal) {
if (this._layouts[i].y === 0) {
break;
diff --git a/node_modules/recyclerlistview/dist/reactnative/core/sticky/StickyHeader.js b/node_modules/recyclerlistview/dist/reactnative/core/sticky/StickyHeader.js
index 7074f36..5e72f6e 100644
--- a/node_modules/recyclerlistview/dist/reactnative/core/sticky/StickyHeader.js
Expand Down
37 changes: 24 additions & 13 deletions src/components/asset-list/AssetList.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import PropTypes from 'prop-types';
import React from 'react';
import { onlyUpdateForKeys } from 'recompact';
import { compose, onlyUpdateForKeys } from 'recompact';
import { withIsWalletImporting } from '../../hoc';
import { safeAreaInsetValues } from '../../utils';
import { FabWrapper, FloatingActionButton } from '../fab';
import { ListFooter } from '../list';
Expand All @@ -14,21 +15,26 @@ const AssetList = ({
fetchData,
hideHeader,
isEmpty,
sections,
isImporting,
isWalletEthZero,
scrollViewTracker,
sections,
...props
}) => (
isEmpty
? <EmptyAssetList {...props} />
: (
<RecyclerAssetList
scrollViewTracker={scrollViewTracker}
(isEmpty || isImporting)
? (
<EmptyAssetList
{...props}
enablePullToRefresh
isWalletEthZero={isImporting ? false : isWalletEthZero}
/>
) : (
<RecyclerAssetList
fetchData={fetchData}
hideHeader={hideHeader}
paddingBottom={PaddingBottom}
scrollViewTracker={scrollViewTracker}
sections={sections}
{...props}
/>
)
);
Expand All @@ -37,13 +43,18 @@ AssetList.propTypes = {
fetchData: PropTypes.func.isRequired,
hideHeader: PropTypes.bool,
isEmpty: PropTypes.bool,
isImporting: PropTypes.bool,
isWalletEthZero: PropTypes.bool,
scrollViewTracker: PropTypes.object,
sections: PropTypes.arrayOf(PropTypes.object),
};

export default onlyUpdateForKeys([
'isEmpty',
'isWalletEthZero',
'sections',
])(AssetList);
export default compose(
withIsWalletImporting,
onlyUpdateForKeys([
'isEmpty',
'isImporting',
'isWalletEthZero',
'sections',
]),
)(AssetList);
5 changes: 5 additions & 0 deletions src/components/asset-list/EmptyAssetList.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import lang from 'i18n-js';
import { times } from 'lodash';
import PropTypes from 'prop-types';
import React from 'react';
import { withNeverRerender } from '../../hoc';
import { position } from '../../styles';
Expand Down Expand Up @@ -32,4 +33,8 @@ const EmptyAssetList = ({ isWalletEthZero, ...props }) => (
</Column>
);

EmptyAssetList.propTypes = {
isWalletEthZero: PropTypes.bool,
};

export default withNeverRerender(EmptyAssetList);
4 changes: 2 additions & 2 deletions src/components/asset-list/RecyclerAssetList.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,14 +394,14 @@ class RecyclerAssetList extends Component {

rowRenderer = (type, data, index) => {
if (isNil(data) || isNil(index)) {
return null;
return NOOP;
}

const { item = {}, renderItem } = data;
const { hideHeader, sections } = this.props;

if (type === ViewTypes.HEADER) {
return hideHeader ? null : <AssetListHeaderRenderer {...data} />;
return hideHeader ? NOOP : <AssetListHeaderRenderer {...data} />;
}

const isNotUniqueToken = (
Expand Down
101 changes: 0 additions & 101 deletions src/components/list/SectionList.js

This file was deleted.

1 change: 0 additions & 1 deletion src/components/list/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ export { default as ListHeader } from './ListHeader';
export { default as ListItem } from './ListItem';
export { default as ListItemArrowGroup } from './ListItemArrowGroup';
export { default as ListItemDivider } from './ListItemDivider';
export { default as SectionList } from './SectionList';
1 change: 1 addition & 0 deletions src/hoc/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export { default as withHideSplashScreen } from './withHideSplashScreen';
export { default as withImageDimensionsCache } from './withImageDimensionsCache';
export { default as withIsWalletEmpty } from './withIsWalletEmpty';
export { default as withIsWalletEthZero } from './withIsWalletEthZero';
export { default as withIsWalletImporting } from './withIsWalletImporting';
export { default as withMessageSigningScreen } from './withMessageSigningScreen';
export { default as withNetInfo } from './withNetInfo';
export { default as withNeverRerender } from './withNeverRerender';
Expand Down
13 changes: 9 additions & 4 deletions src/hoc/withDataInit.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ import {
} from '../redux/walletconnect';
import withHideSplashScreen from './withHideSplashScreen';

const PromiseAllWithFails = async (promises) => (
Promise.all(promises.map(promise => (
(promise && promise.catch)
? promise.catch(error => error)
: promise
))));

export default Component => compose(
connect(null, {
clearIsWalletEmpty,
Expand Down Expand Up @@ -80,8 +87,7 @@ export default Component => compose(
const p6 = ownProps.nonceClearState();
const p7 = ownProps.requestsClearState();
const p8 = ownProps.uniswapClearState();
const promises = [p1, p2, p3, p4, p5, p6, p7, p8];
await Promise.all(promises.map(p => p.catch(e => e)));
return PromiseAllWithFails([p1, p2, p3, p4, p5, p6, p7, p8]);
},
initializeAccountData: (ownProps) => async () => {
try {
Expand All @@ -98,8 +104,7 @@ export default Component => compose(
const p4 = ownProps.walletConnectLoadState();
const p5 = ownProps.uniswapLoadState();
const p6 = ownProps.requestsLoadState();
const promises = [p1, p2, p3, p4, p5, p6];
await Promise.all(promises.map(p => p.catch(e => e)));
return PromiseAllWithFails([p1, p2, p3, p4, p5, p6]);
},
refreshAccountData: (ownProps) => async () => {
try {
Expand Down
Loading

0 comments on commit 0791a69

Please sign in to comment.