@blocklet/ui-react 2.11.45 → 2.11.46
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.
|
@@ -55,6 +55,7 @@ const translations = {
|
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
57
|
const ONE_MONTH = 1e3 * 60 * 60 * 24 * 30;
|
|
58
|
+
const DASHBOARD_DOMAIN = ".well-known/service/admin/domains";
|
|
58
59
|
export default function DomainWarning({ locale, session }) {
|
|
59
60
|
const user = session?.user;
|
|
60
61
|
const isMobile = useMobile();
|
|
@@ -92,13 +93,16 @@ export default function DomainWarning({ locale, session }) {
|
|
|
92
93
|
setOpen(false);
|
|
93
94
|
}, []);
|
|
94
95
|
const handleDomainConfig = useCallback(() => {
|
|
95
|
-
const adminUrl = joinURL(window.location.origin,
|
|
96
|
+
const adminUrl = joinURL(window.location.origin, DASHBOARD_DOMAIN);
|
|
96
97
|
if (adminUrl.startsWith("http")) {
|
|
97
98
|
window.open(adminUrl, "_blank");
|
|
98
99
|
}
|
|
99
100
|
setOpen(false);
|
|
100
101
|
}, []);
|
|
101
102
|
const isOwner = user?.role && isAdmin.includes(user.role);
|
|
103
|
+
if (window.location.href.includes(DASHBOARD_DOMAIN)) {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
102
106
|
if (isMobile) {
|
|
103
107
|
return null;
|
|
104
108
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/ui-react",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.46",
|
|
4
4
|
"description": "Some useful front-end web components that can be used in Blocklets.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@abtnode/constant": "^1.16.38",
|
|
36
|
-
"@arcblock/bridge": "^2.11.
|
|
37
|
-
"@arcblock/react-hooks": "^2.11.
|
|
36
|
+
"@arcblock/bridge": "^2.11.46",
|
|
37
|
+
"@arcblock/react-hooks": "^2.11.46",
|
|
38
38
|
"@arcblock/ws": "^1.19.9",
|
|
39
39
|
"@blocklet/did-space-react": "^1.0.16",
|
|
40
40
|
"@iconify-icons/logos": "^1.2.36",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"jest": "^29.7.0",
|
|
85
85
|
"unbuild": "^2.0.0"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "289036b9e8092ce23314bece14c61c6ae8a7c757"
|
|
88
88
|
}
|
|
@@ -65,6 +65,8 @@ const translations = {
|
|
|
65
65
|
|
|
66
66
|
const ONE_MONTH = 1000 * 60 * 60 * 24 * 30;
|
|
67
67
|
|
|
68
|
+
const DASHBOARD_DOMAIN = '.well-known/service/admin/domains';
|
|
69
|
+
|
|
68
70
|
export default function DomainWarning({ locale, session }) {
|
|
69
71
|
const user = session?.user;
|
|
70
72
|
const isMobile = useMobile();
|
|
@@ -108,7 +110,7 @@ export default function DomainWarning({ locale, session }) {
|
|
|
108
110
|
}, []);
|
|
109
111
|
|
|
110
112
|
const handleDomainConfig = useCallback(() => {
|
|
111
|
-
const adminUrl = joinURL(window.location.origin,
|
|
113
|
+
const adminUrl = joinURL(window.location.origin, DASHBOARD_DOMAIN);
|
|
112
114
|
if (adminUrl.startsWith('http')) {
|
|
113
115
|
window.open(adminUrl, '_blank');
|
|
114
116
|
}
|
|
@@ -117,6 +119,10 @@ export default function DomainWarning({ locale, session }) {
|
|
|
117
119
|
|
|
118
120
|
const isOwner = user?.role && isAdmin.includes(user.role);
|
|
119
121
|
|
|
122
|
+
if (window.location.href.includes(DASHBOARD_DOMAIN)) {
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
|
|
120
126
|
if (isMobile) {
|
|
121
127
|
return null;
|
|
122
128
|
}
|