mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
Harden profile data loading
This commit is contained in:
1 parent
5f439d6863
commit
b774de6d76
7 files changed
+237
-59
No files matched your search
@@ -196,6 +196,7 @@ export function parseCachedSubscriptionSnapshot(cached) {
|
||||
subscribedPubkeys: normalized,
|
||||
eventId: null,
|
||||
createdAt: null,
|
||||
eventPubkey: null,
|
||||
hasSnapshot: true,
|
||||
};
|
||||
}
|
||||
@@ -220,6 +221,7 @@ export function parseCachedSubscriptionSnapshot(cached) {
|
||||
const createdAt = Number.isFinite(createdAtCandidate)
|
||||
? Math.floor(createdAtCandidate)
|
||||
: null;
|
||||
const eventPubkey = normalizeHexPubkey(cached.eventPubkey);
|
||||
const hasSnapshot =
|
||||
Array.isArray(cached.subscribedPubkeys) ||
|
||||
Array.isArray(cached.subPubkeys) ||
|
||||
@@ -229,6 +231,7 @@ export function parseCachedSubscriptionSnapshot(cached) {
|
||||
subscribedPubkeys: normalized,
|
||||
eventId,
|
||||
createdAt,
|
||||
eventPubkey,
|
||||
hasSnapshot,
|
||||
};
|
||||
}
|
||||
@@ -237,6 +240,7 @@ export function parseCachedSubscriptionSnapshot(cached) {
|
||||
subscribedPubkeys: [],
|
||||
eventId: null,
|
||||
createdAt: null,
|
||||
eventPubkey: null,
|
||||
hasSnapshot: false,
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user