@arcblock/ux 2.13.16 → 2.13.17

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.
@@ -24,7 +24,10 @@ export default function UserInfo({
24
24
  return translate(translations, key, locale, 'en', data);
25
25
  });
26
26
  const avatar = getUserAvatar(session.user?.avatar?.replace(/\s/g, encodeURIComponent(' ')), 64);
27
- const currentRole = useCreation(() => session.user?.passports?.find(item => item.name === session.user.role), [session?.user?.passports, session?.user?.role]);
27
+ const currentRole = useCreation(() => {
28
+ // FIXME: @zhanghan 感觉应该把 name 的判断去掉?
29
+ return session.user?.passports?.find(item => item.name === session.user.role || item.role === session.user.role);
30
+ }, [session?.user?.passports, session?.user?.role]);
28
31
  const hasBindWallet = useCreation(() => {
29
32
  return getWallet(session?.user);
30
33
  }, [session?.user]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcblock/ux",
3
- "version": "2.13.16",
3
+ "version": "2.13.17",
4
4
  "description": "Common used react components for arcblock products",
5
5
  "keywords": [
6
6
  "react",
@@ -71,14 +71,14 @@
71
71
  "react": ">=18.2.0",
72
72
  "react-router-dom": ">=6.22.3"
73
73
  },
74
- "gitHead": "ccf3113f17409f98eb34b43a18f532effef9bd9b",
74
+ "gitHead": "cd775f10e9f90ed9813c8fd401fdae7c327c9c44",
75
75
  "dependencies": {
76
76
  "@arcblock/did-motif": "^1.1.13",
77
- "@arcblock/icons": "^2.13.16",
78
- "@arcblock/nft-display": "^2.13.16",
79
- "@arcblock/react-hooks": "^2.13.16",
77
+ "@arcblock/icons": "^2.13.17",
78
+ "@arcblock/nft-display": "^2.13.17",
79
+ "@arcblock/react-hooks": "^2.13.17",
80
80
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
81
- "@blocklet/theme": "^2.13.16",
81
+ "@blocklet/theme": "^2.13.17",
82
82
  "@fontsource/roboto": "~5.1.1",
83
83
  "@fontsource/ubuntu-mono": "^5.0.18",
84
84
  "@iconify-icons/logos": "^1.2.36",
@@ -36,10 +36,12 @@ export default function UserInfo({
36
36
  return translate(translations, key, locale, 'en', data);
37
37
  });
38
38
  const avatar = getUserAvatar(session.user?.avatar?.replace(/\s/g, encodeURIComponent(' ')), 64);
39
- const currentRole = useCreation(
40
- () => session.user?.passports?.find((item: $TSFixMe) => item.name === session.user.role),
41
- [session?.user?.passports, session?.user?.role]
42
- );
39
+ const currentRole = useCreation(() => {
40
+ // FIXME: @zhanghan 感觉应该把 name 的判断去掉?
41
+ return session.user?.passports?.find(
42
+ (item: $TSFixMe) => item.name === session.user.role || item.role === session.user.role
43
+ );
44
+ }, [session?.user?.passports, session?.user?.role]);
43
45
 
44
46
  const hasBindWallet = useCreation(() => {
45
47
  return getWallet(session?.user);