@lark-apaas/client-toolkit 1.2.24-alpha.1 → 1.2.24-alpha.10

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.
@@ -14,32 +14,18 @@ const Component = ()=>{
14
14
  const isMobile = useIsMobile();
15
15
  const [userinfo, setUserinfo] = useState(null);
16
16
  const [isInternetVisible, setIsInternetVisible] = useState(false);
17
- const [showBadge, setShowBadge] = useState(true);
18
- const [badgeLoaded, setBadgeLoaded] = useState(false);
19
17
  const timeoutRef = useRef(null);
20
18
  useEffect(()=>{
21
19
  const appId = getAppId();
22
- const csrfHeaders = {
23
- 'X-Suda-Csrf-Token': getCsrfToken()
24
- };
25
20
  const tenantInfoUrl = isNewPathEnabled() ? `/app/${appId}/__runtime__/api/v1/studio/tenant_info` : `/spark/b/${appId}/tenant_info`;
26
21
  fetch(tenantInfoUrl, {
27
- headers: csrfHeaders
22
+ headers: {
23
+ 'X-Suda-Csrf-Token': getCsrfToken()
24
+ }
28
25
  }).then((res)=>res.json()).then((data)=>{
29
26
  setUserinfo(data?.data?.tenant_info);
30
27
  setIsInternetVisible(data?.data?.is_internet_visible);
31
28
  });
32
- const getPublishedUrl = `/spark/b/${appId}/get_published`;
33
- fetch(getPublishedUrl, {
34
- headers: csrfHeaders
35
- }).then((res)=>res.json()).then((data)=>{
36
- const badge = data?.data?.app_info?.show_badge;
37
- setShowBadge(false !== badge);
38
- }).catch(()=>{
39
- setShowBadge(true);
40
- }).finally(()=>{
41
- setBadgeLoaded(true);
42
- });
43
29
  }, []);
44
30
  useEffect(()=>{
45
31
  if (isMobile) {
@@ -53,8 +39,6 @@ const Component = ()=>{
53
39
  isMobile
54
40
  ]);
55
41
  if ('production' !== process.env.NODE_ENV) return null;
56
- if (!badgeLoaded) return null;
57
- if (!showBadge) return null;
58
42
  if (!visible) return null;
59
43
  if (isMobile) return /*#__PURE__*/ jsxs(Sheet, {
60
44
  open: open,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/client-toolkit",
3
- "version": "1.2.24-alpha.1",
3
+ "version": "1.2.24-alpha.10",
4
4
  "types": "./lib/index.d.ts",
5
5
  "main": "./lib/index.js",
6
6
  "files": [
@@ -103,7 +103,7 @@
103
103
  "@lark-apaas/auth-sdk": "^0.1.2",
104
104
  "@lark-apaas/client-capability": "^0.1.6",
105
105
  "@lark-apaas/internal-slardar": "^0.0.3",
106
- "@lark-apaas/miaoda-inspector": "^1.0.20",
106
+ "@lark-apaas/miaoda-inspector": "1.0.14-alpha.25",
107
107
  "@lark-apaas/observable-web": "^1.0.4",
108
108
  "@radix-ui/react-avatar": "^1.1.10",
109
109
  "@radix-ui/react-popover": "^1.1.15",