mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-09 06:12:56 +00:00
fix(subscriptions): improve reliability of list loading and button responsiveness
- Implemented optimistic UI updates for the channel subscribe button to improve responsiveness. - Fixed a race condition in `js/subscriptions.js` and `js/services/hashtagPreferencesService.js` where lists were wiped on refresh due to `profileCache.activePubkey` not being initialized in time. Now using `profileCache.getProfileData(pubkey, ...)` to ensure the correct cache entry is loaded. - Validated with targeted unit tests. Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
560dcf96b0
commit
73541168f7
4 files changed
+81
-3
No files matched your search
+1
-1
@@ -310,7 +310,7 @@ class SubscriptionsManager {
|
||||
const normalizedUserPubkey = normalizeHexPubkey(userPubkey) || userPubkey;
|
||||
|
||||
// 1. Attempt to load from cache first
|
||||
const cached = profileCache.get("subscriptions");
|
||||
const cached = profileCache.getProfileData(normalizedUserPubkey, "subscriptions");
|
||||
if (Array.isArray(cached)) {
|
||||
devLogger.log("[SubscriptionsManager] Loaded subscriptions from cache.");
|
||||
this.subscribedPubkeys = new Set(cached);
|
||||
|
||||
Reference in new issue
Block a user