@lynn123411/dsh-a6api 1.4.1 → 1.5.0
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/README.md +5 -4
- package/lib/client.js +229 -158
- package/lib/client.js.map +4 -4
- package/lib/index.js +13 -5
- package/lib/index.js.map +2 -2
- package/lib/types/client/components/A6ApiSidebarCard.d.ts +2 -1
- package/lib/types/client/components/MarketPill.d.ts +6 -0
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -810,11 +810,19 @@ async function fetchPriceFluctuation(userId, accessToken) {
|
|
|
810
810
|
let unseen = unseenPick.value;
|
|
811
811
|
const total = arr.length;
|
|
812
812
|
if (!pendingPick.present && arr.length > 0) {
|
|
813
|
-
const
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
813
|
+
const isPendingNotice = (n) => {
|
|
814
|
+
if (n?.pending === true) return true;
|
|
815
|
+
const rels = Array.isArray(n?.relations) ? n.relations : [];
|
|
816
|
+
if (rels.length > 0) {
|
|
817
|
+
return rels.some((r) => String(r?.state ?? "").toLowerCase() === "open");
|
|
818
|
+
}
|
|
819
|
+
const s = String(n?.state ?? n?.status ?? "").toLowerCase();
|
|
820
|
+
return s === "open" || s === "pending" || s === "effective";
|
|
821
|
+
};
|
|
822
|
+
const counted = arr.filter(isPendingNotice).length;
|
|
823
|
+
const hasState = arr.some(
|
|
824
|
+
(n) => n.state !== void 0 || n.status !== void 0 || Array.isArray(n.relations) && n.relations.length > 0
|
|
825
|
+
);
|
|
818
826
|
if (hasState) pending = counted;
|
|
819
827
|
}
|
|
820
828
|
if (!unseenPick.present && arr.length > 0) {
|