aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-10-02 14:46:32 -0700
committerAdam Soltys <[email protected]>2026-10-02 14:46:32 -0700
commitc89050e6c54e331003a6e97d89d1e2a2e2083335 (patch)
treebc11bca3b40301a9db6ea61e54c33505d16c6290 /src
parentdbee3dddba70783aa66b933ee48a187ef758efaa (diff)
downloadcoinosv3-c89050e6c54e331003a6e97d89d1e2a2e2083335.tar.gz
coinosv3-c89050e6c54e331003a6e97d89d1e2a2e2083335.zip
The feed you were on is remembered per wallet; new ones start on Popular
It was one device-wide key, so a new account opened on whatever the last one was reading (#gardenstr: the starter feed has the same id in every account). Now keyed by the wallet, re-read when a wallet opens (the feature outlives a sign-out), Popular when nothing is remembered, and the old device-wide key is dropped. A feed opened from a link stays put. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Dmcrt9KyNDKVWFKnb8BREo
Diffstat (limited to 'src')
-rw-r--r--src/features/messages.js20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/features/messages.js b/src/features/messages.js
index 68eefda..5f9d1dc 100644
--- a/src/features/messages.js
+++ b/src/features/messages.js
@@ -4054,12 +4054,18 @@ export function messagesFeature(ctx) {
// clock and disk cache. A topic opened from search or a #tag in a post is
// a feed too, until saved just a session one.
const FOLLOWING = 'following';
- const FEED_LS = 'btc-wallet-feed'; // the feed last on screen, remembered per device
+ // The feed last on screen, remembered per wallet on this device. It used to
+ // be one device-wide key, so a brand-new account opened on whatever the
+ // last one was reading (its #gardenstr starter feed has the same id in
+ // every account). Nothing remembered: Popular.
+ const FEED_LS = 'btc-wallet-feed';
+ const feedLsKey = () => FEED_LS + ':' + (wallet._cacheKey ? wallet._cacheKey() : '');
+ const storedFeedId = () => { try { return localStorage.getItem(feedLsKey()) || null; } catch { return null; } };
const feedStates = new Map(); // id -> state
const adhocFeeds = new Map(); // id -> definition, this session only
// the feed of your own you last had on (never a session one)
- const homeFeedId = () => { let id = FOLLOWING; try { id = localStorage.getItem(FEED_LS) || FOLLOWING; } catch {} return feedDef(id) && !adhocFeeds.has(id) ? id : FOLLOWING; };
- let curFeedId = (() => { try { return localStorage.getItem(FEED_LS) || FOLLOWING; } catch { return FOLLOWING; } })();
+ const homeFeedId = () => { const id = storedFeedId() || EVERYTHING; return feedDef(id) && !adhocFeeds.has(id) ? id : EVERYTHING; };
+ let curFeedId = storedFeedId() || 'all'; // EVERYTHING, declared just below (re-read per wallet in init)
// Two feeds everyone has: the people you follow, and everything the coinos
// relay carries. Each remembers its own relay choice in the state.
const EVERYTHING = 'all';
@@ -4645,7 +4651,7 @@ export function messagesFeature(ctx) {
}
function feedNow() {
- if (!feedDef(curFeedId)) curFeedId = FOLLOWING; // a feed deleted on another device
+ if (!feedDef(curFeedId)) curFeedId = EVERYTHING; // a feed deleted on another device
let c = feedStates.get(curFeedId);
if (!c) {
let stored = [];
@@ -4743,7 +4749,7 @@ export function messagesFeature(ctx) {
if (feedDef(id).of) loadOfFollows(feedDef(id));
if (id !== curFeedId) {
curFeedId = id;
- if (!adhocFeeds.has(id)) { try { localStorage.setItem(FEED_LS, id); } catch {} }
+ if (!adhocFeeds.has(id)) { try { localStorage.setItem(feedLsKey(), id); } catch {} }
}
ui.feedId = id;
stopFeedWatch();
@@ -10558,6 +10564,10 @@ export function messagesFeature(ctx) {
avatarNode(pk, cls) { return avatar(pk, cls || 'chat-avatar mini', false); },
init() {
const session = ++feedWarmSession;
+ // this wallet's own feed (the feature outlives a sign-out): a feed
+ // opened from a link stays put
+ if (!adhocFeeds.has(curFeedId)) { curFeedId = homeFeedId(); if (ui.feedId && !adhocFeeds.has(ui.feedId)) ui.feedId = curFeedId; }
+ try { localStorage.removeItem(FEED_LS); } catch {} // the old device-wide choice: nobody's in particular
returnAfterSignin(); // a visitor who signed in from a feed or profile lands back on it
// /feed opened before the wallet restored made a visitor's session copy
// of Popular; with the wallet here, the built-in one takes over (two