@blocklet/ui-react 2.13.2 → 2.13.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -137,9 +137,11 @@ export default function UserMetadataComponent({
137
137
  };
138
138
  }
139
139
  if (phone && typeof phone === "object") {
140
+ const { country: phoneCountry = "", phoneNumber = "" } = phone;
141
+ const detectedCountry = !phoneCountry ? detectCountryFromPhone(phoneNumber) || "" : phoneCountry;
140
142
  return {
141
- country: phone.country,
142
- phone: phone.phoneNumber || ""
143
+ country: detectedCountry,
144
+ phone: phoneNumber || ""
143
145
  };
144
146
  }
145
147
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/ui-react",
3
- "version": "2.13.2",
3
+ "version": "2.13.3",
4
4
  "description": "Some useful front-end web components that can be used in Blocklets.",
5
5
  "keywords": [
6
6
  "react",
@@ -34,8 +34,8 @@
34
34
  "dependencies": {
35
35
  "@abtnode/constant": "^1.16.42",
36
36
  "@abtnode/util": "^1.16.42",
37
- "@arcblock/bridge": "^2.13.2",
38
- "@arcblock/react-hooks": "^2.13.2",
37
+ "@arcblock/bridge": "^2.13.3",
38
+ "@arcblock/react-hooks": "^2.13.3",
39
39
  "@arcblock/ws": "^1.20.0",
40
40
  "@blocklet/constant": "^1.16.42",
41
41
  "@blocklet/did-space-react": "^1.0.47",
@@ -94,5 +94,5 @@
94
94
  "jest": "^29.7.0",
95
95
  "unbuild": "^2.0.0"
96
96
  },
97
- "gitHead": "20a687d035cac39b37ddcbbc478afc416efe2877"
97
+ "gitHead": "22439fa4a1d2b412279cbb61eadb1981f62dc7a5"
98
98
  }
@@ -175,9 +175,12 @@ export default function UserMetadataComponent({
175
175
  };
176
176
  }
177
177
  if (phone && typeof phone === 'object') {
178
+ const { country: phoneCountry = '', phoneNumber = '' } = phone as UserPhoneProps;
179
+ const detectedCountry = !phoneCountry ? detectCountryFromPhone(phoneNumber) || '' : phoneCountry;
180
+
178
181
  return {
179
- country: phone.country,
180
- phone: (phone as UserPhoneProps).phoneNumber || '',
182
+ country: detectedCountry,
183
+ phone: phoneNumber || '',
181
184
  };
182
185
  }
183
186