@lark-apaas/client-toolkit-lite 1.1.39 → 1.1.40-alpha.20261104054544
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.
- package/dist/index.cjs +14 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +14 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1306,7 +1306,7 @@ async function getAppInfo(refresh = false) {
|
|
|
1306
1306
|
const info = (await getInitialInfo(refresh))?.app_info;
|
|
1307
1307
|
appInfo = {
|
|
1308
1308
|
name: info?.app_name || "",
|
|
1309
|
-
avatar: info?.app_avatar
|
|
1309
|
+
avatar: normalizeAvatar(info?.app_avatar),
|
|
1310
1310
|
description: info?.app_description || ""
|
|
1311
1311
|
};
|
|
1312
1312
|
if (appInfo.name) {
|
|
@@ -1319,6 +1319,19 @@ async function getAppInfo(refresh = false) {
|
|
|
1319
1319
|
return appInfo ?? {};
|
|
1320
1320
|
}
|
|
1321
1321
|
__name(getAppInfo, "getAppInfo");
|
|
1322
|
+
function normalizeAvatar(raw) {
|
|
1323
|
+
if (!raw) return "";
|
|
1324
|
+
if (raw.trim().startsWith("{")) {
|
|
1325
|
+
try {
|
|
1326
|
+
const url = JSON.parse(raw)?.url;
|
|
1327
|
+
return typeof url === "string" ? url : "";
|
|
1328
|
+
} catch {
|
|
1329
|
+
return "";
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
return raw;
|
|
1333
|
+
}
|
|
1334
|
+
__name(normalizeAvatar, "normalizeAvatar");
|
|
1322
1335
|
|
|
1323
1336
|
// src/hooks/useAppInfo.tsx
|
|
1324
1337
|
var useAppInfo = /* @__PURE__ */ __name(() => {
|