@blocklet/ui-react 2.13.5 → 2.13.6
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.
|
@@ -21,10 +21,12 @@ import { useContext } from "react";
|
|
|
21
21
|
import pick from "lodash/pick";
|
|
22
22
|
import { getFederatedEnabled, getMaster } from "@arcblock/ux/lib/Util/federated";
|
|
23
23
|
import { LOGIN_PROVIDER, LOGIN_PROVIDER_NAME } from "@arcblock/ux/lib/Util/constant";
|
|
24
|
+
import { useStateContext } from "@arcblock/did-connect/lib/Connect/contexts/state";
|
|
24
25
|
import { translations } from "../../libs/locales.js";
|
|
25
26
|
export default function ThirdPartyItem({
|
|
26
27
|
item
|
|
27
28
|
}) {
|
|
29
|
+
const { blocklet: targetBlocklet } = useStateContext();
|
|
28
30
|
const { confirmApi, confirmHolder } = useConfirm();
|
|
29
31
|
const currentState = useReactive({
|
|
30
32
|
loading: false
|
|
@@ -35,7 +37,7 @@ export default function ThirdPartyItem({
|
|
|
35
37
|
});
|
|
36
38
|
const { session } = useContext(SessionContext);
|
|
37
39
|
const { bindOAuth, unbindOAuth, setBaseUrl, baseUrl: oauthBaseUrl } = session.useOAuth();
|
|
38
|
-
const { disconnectPasskey } = session.usePasskey();
|
|
40
|
+
const { disconnectPasskey, setTargetAppPid } = session.usePasskey();
|
|
39
41
|
const iconMap = {
|
|
40
42
|
// email: MailOutlineRoundedIcon,
|
|
41
43
|
[LOGIN_PROVIDER.AUTH0]: MailOutlineRoundedIcon,
|
|
@@ -108,6 +110,7 @@ export default function ThirdPartyItem({
|
|
|
108
110
|
baseUrl = master.appUrl;
|
|
109
111
|
}
|
|
110
112
|
setBaseUrl(baseUrl);
|
|
113
|
+
setTargetAppPid(targetBlocklet?.appPid);
|
|
111
114
|
bindOAuth({
|
|
112
115
|
session,
|
|
113
116
|
oauthItem: {
|
|
@@ -116,6 +119,7 @@ export default function ThirdPartyItem({
|
|
|
116
119
|
}
|
|
117
120
|
}).then(resolve).catch(reject).finally(() => {
|
|
118
121
|
setBaseUrl(backupBaseUrl);
|
|
122
|
+
setTargetAppPid();
|
|
119
123
|
});
|
|
120
124
|
}
|
|
121
125
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/ui-react",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.6",
|
|
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.
|
|
38
|
-
"@arcblock/react-hooks": "^2.13.
|
|
37
|
+
"@arcblock/bridge": "^2.13.6",
|
|
38
|
+
"@arcblock/react-hooks": "^2.13.6",
|
|
39
39
|
"@arcblock/ws": "^1.20.1",
|
|
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": "
|
|
97
|
+
"gitHead": "1cc41a6a655f93eb1536a9dd36fe3979a2c654c8"
|
|
98
98
|
}
|
|
@@ -21,6 +21,7 @@ import { useContext } from 'react';
|
|
|
21
21
|
import pick from 'lodash/pick';
|
|
22
22
|
import { getFederatedEnabled, getMaster } from '@arcblock/ux/lib/Util/federated';
|
|
23
23
|
import { LOGIN_PROVIDER, LOGIN_PROVIDER_NAME, OAUTH_PROVIDER } from '@arcblock/ux/lib/Util/constant';
|
|
24
|
+
import { useStateContext } from '@arcblock/did-connect/lib/Connect/contexts/state';
|
|
24
25
|
|
|
25
26
|
import { translations } from '../../libs/locales';
|
|
26
27
|
import type { OAuthAccount, SessionContext as TSessionContext } from '../../../@types';
|
|
@@ -39,6 +40,7 @@ export default function ThirdPartyItem({
|
|
|
39
40
|
_mainProvider?: boolean;
|
|
40
41
|
};
|
|
41
42
|
}) {
|
|
43
|
+
const { blocklet: targetBlocklet } = useStateContext();
|
|
42
44
|
const { confirmApi, confirmHolder } = useConfirm();
|
|
43
45
|
const currentState = useReactive({
|
|
44
46
|
loading: false,
|
|
@@ -49,7 +51,7 @@ export default function ThirdPartyItem({
|
|
|
49
51
|
});
|
|
50
52
|
const { session } = useContext<TSessionContext>(SessionContext);
|
|
51
53
|
const { bindOAuth, unbindOAuth, setBaseUrl, baseUrl: oauthBaseUrl } = session.useOAuth();
|
|
52
|
-
const { disconnectPasskey } = session.usePasskey();
|
|
54
|
+
const { disconnectPasskey, setTargetAppPid } = session.usePasskey();
|
|
53
55
|
|
|
54
56
|
const iconMap = {
|
|
55
57
|
// email: MailOutlineRoundedIcon,
|
|
@@ -128,6 +130,8 @@ export default function ThirdPartyItem({
|
|
|
128
130
|
baseUrl = master.appUrl;
|
|
129
131
|
}
|
|
130
132
|
setBaseUrl(baseUrl);
|
|
133
|
+
// @ts-ignore
|
|
134
|
+
setTargetAppPid(targetBlocklet?.appPid);
|
|
131
135
|
bindOAuth({
|
|
132
136
|
session,
|
|
133
137
|
oauthItem: {
|
|
@@ -139,6 +143,7 @@ export default function ThirdPartyItem({
|
|
|
139
143
|
.catch(reject)
|
|
140
144
|
.finally(() => {
|
|
141
145
|
setBaseUrl(backupBaseUrl);
|
|
146
|
+
setTargetAppPid();
|
|
142
147
|
});
|
|
143
148
|
}
|
|
144
149
|
});
|