From 01844aef53466e2d5ebd78046a81103e5c3b0a92 Mon Sep 17 00:00:00 2001 From: ryanml Date: Tue, 1 Feb 2022 20:11:42 -0700 Subject: [PATCH 1/4] Handling array type values for image in Identicon component (#13484) * Handling array type values for image in Identicon component * Adding additional type check --- ui/components/ui/identicon/identicon.component.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ui/components/ui/identicon/identicon.component.js b/ui/components/ui/identicon/identicon.component.js index b546b85c1..8174ab38e 100644 --- a/ui/components/ui/identicon/identicon.component.js +++ b/ui/components/ui/identicon/identicon.component.js @@ -34,7 +34,7 @@ export default class Identicon extends PureComponent { /** * Used as the image source of the Identicon */ - image: PropTypes.string, + image: PropTypes.oneOfType([PropTypes.string, PropTypes.array]), /** * Use the blockie type random image generator */ @@ -76,7 +76,14 @@ export default class Identicon extends PureComponent { const { className, diameter, alt, imageBorder, ipfsGateway } = this.props; let { image } = this.props; - if (image.toLowerCase().startsWith('ipfs://')) { + if (Array.isArray(image) && image.length) { + image = image[0]; + } + + if ( + typeof image === 'string' && + image.toLowerCase().startsWith('ipfs://') + ) { image = getAssetImageURL(image, ipfsGateway); } From 7c9e17f598df5b0bc2ab527b801cdfa930d079fc Mon Sep 17 00:00:00 2001 From: MetaMask Bot Date: Wed, 2 Feb 2022 03:16:53 +0000 Subject: [PATCH 2/4] Version v10.9.1 --- CHANGELOG.md | 7 ++++++- package.json | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d70fa6ef..c9f04e23e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [10.9.1] +### Uncategorized +- Handling array type values for image in Identicon component ([#13484](https://github.com/MetaMask/metamask-extension/pull/13484)) + ## [10.9.0] ### Added - Alert users when the network is busy ([#12268](https://github.com/MetaMask/metamask-extension/pull/12268)) @@ -2687,7 +2691,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Uncategorized - Added the ability to restore accounts from seed words. -[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.9.0...HEAD +[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.9.1...HEAD +[10.9.1]: https://github.com/MetaMask/metamask-extension/compare/v10.9.0...v10.9.1 [10.9.0]: https://github.com/MetaMask/metamask-extension/compare/v10.8.2...v10.9.0 [10.8.2]: https://github.com/MetaMask/metamask-extension/compare/v10.8.1...v10.8.2 [10.8.1]: https://github.com/MetaMask/metamask-extension/compare/v10.8.0...v10.8.1 diff --git a/package.json b/package.json index c6f2905ee..cea8613eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "metamask-crx", - "version": "10.9.0", + "version": "10.9.1", "private": true, "repository": { "type": "git", From 3dde05dbce9cdf717c27e0b060cc3d28598e43ff Mon Sep 17 00:00:00 2001 From: Brad Decker Date: Mon, 31 Jan 2022 08:46:25 -0600 Subject: [PATCH 3/4] add resolution for simple-get (#13471) --- package.json | 3 ++- yarn.lock | 37 ++++++++++++++----------------------- 2 files changed, 16 insertions(+), 24 deletions(-) diff --git a/package.json b/package.json index cea8613eb..98e38385e 100644 --- a/package.json +++ b/package.json @@ -92,7 +92,8 @@ "pubnub/superagent-proxy": "^3.0.0", "pull-ws": "^3.3.2", "ws": "^7.4.6", - "json-schema": "^0.4.0" + "json-schema": "^0.4.0", + "simple-get": "^4.0.1" }, "dependencies": { "3box": "^1.10.2", diff --git a/yarn.lock b/yarn.lock index d6cce7d46..1fd77eb86 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9582,12 +9582,12 @@ decompress-response@^3.2.0, decompress-response@^3.3.0: dependencies: mimic-response "^1.0.0" -decompress-response@^4.2.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-4.2.1.tgz#414023cc7a302da25ce2ec82d0d5238ccafd8986" - integrity sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw== +decompress-response@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc" + integrity sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ== dependencies: - mimic-response "^2.0.0" + mimic-response "^3.1.0" dedent@^0.7.0: version "0.7.0" @@ -19435,10 +19435,10 @@ mimic-response@^1.0.0, mimic-response@^1.0.1: resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== -mimic-response@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-2.1.0.tgz#d13763d35f613d09ec37ebb30bac0469c0ee8f43" - integrity sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA== +mimic-response@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" + integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ== min-document@^2.19.0: version "2.19.0" @@ -25332,21 +25332,12 @@ simple-concat@^1.0.0: resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.0.tgz#7344cbb8b6e26fb27d66b2fc86f9f6d5997521c6" integrity sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY= -simple-get@^2.7.0: - version "2.8.1" - resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-2.8.1.tgz#0e22e91d4575d87620620bc91308d57a77f44b5d" - integrity sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw== +simple-get@^2.7.0, simple-get@^3.0.3, simple-get@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-4.0.1.tgz#4a39db549287c979d352112fa03fd99fd6bc3543" + integrity sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA== dependencies: - decompress-response "^3.3.0" - once "^1.3.1" - simple-concat "^1.0.0" - -simple-get@^3.0.3: - version "3.1.0" - resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-3.1.0.tgz#b45be062435e50d159540b576202ceec40b9c6b3" - integrity sha512-bCR6cP+aTdScaQCnQKbPKtJOKDp/hj9EDLJo3Nw4y1QksqaovlW/bnptB6/c1e+qmNIDHRK+oXFDdEqBT8WzUA== - dependencies: - decompress-response "^4.2.0" + decompress-response "^6.0.0" once "^1.3.1" simple-concat "^1.0.0" From 03969a1a0f0a6af4cbed57618c1471cd0892adac Mon Sep 17 00:00:00 2001 From: ryanml Date: Tue, 1 Feb 2022 20:39:30 -0700 Subject: [PATCH 4/4] Updating changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c9f04e23e..f19b4cb85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ## [10.9.1] -### Uncategorized -- Handling array type values for image in Identicon component ([#13484](https://github.com/MetaMask/metamask-extension/pull/13484)) +### Fixed +- Fixed application error when adding certain tokens ([#13484](https://github.com/MetaMask/metamask-extension/pull/13484)) ## [10.9.0] ### Added