@blocklet/ui-react 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.
@@ -6,7 +6,8 @@ import SwapHorizRoundedIcon from "@iconify-icons/material-symbols/swap-horiz-rou
6
6
  import { useCreation } from "ahooks";
7
7
  function SwitchRole({ user, switchPassport }) {
8
8
  const currentRole = useCreation(
9
- () => (user?.passports || [])?.find((item) => item.name === user.role),
9
+ // FIXME: @zhanghan 感觉应该把 name 的判断去掉?
10
+ () => (user?.passports || [])?.find((item) => item.name === user.role || item.role === user.role),
10
11
  [user?.passports, user?.role]
11
12
  );
12
13
  return /* @__PURE__ */ jsx(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/ui-react",
3
- "version": "2.13.16",
3
+ "version": "2.13.17",
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.16",
38
- "@arcblock/react-hooks": "^2.13.16",
37
+ "@arcblock/bridge": "^2.13.17",
38
+ "@arcblock/react-hooks": "^2.13.17",
39
39
  "@arcblock/ws": "^1.20.2",
40
40
  "@blocklet/constant": "^1.16.42",
41
41
  "@blocklet/did-space-react": "^1.0.48",
@@ -94,5 +94,5 @@
94
94
  "jest": "^29.7.0",
95
95
  "unbuild": "^2.0.0"
96
96
  },
97
- "gitHead": "ccf3113f17409f98eb34b43a18f532effef9bd9b"
97
+ "gitHead": "cd775f10e9f90ed9813c8fd401fdae7c327c9c44"
98
98
  }
@@ -7,7 +7,8 @@ import type { User } from '../../../@types';
7
7
 
8
8
  function SwitchRole({ user, switchPassport }: { user: User; switchPassport: () => void }) {
9
9
  const currentRole = useCreation(
10
- () => (user?.passports || [])?.find((item) => item.name === user.role),
10
+ // FIXME: @zhanghan 感觉应该把 name 的判断去掉?
11
+ () => (user?.passports || [])?.find((item) => item.name === user.role || item.role === user.role),
11
12
  [user?.passports, user?.role]
12
13
  );
13
14