fix(channel): "Show in my feed" lands on the feed, not where you came from
It called closeChannel() before setPage("feed"). closeChannel runs
history.back(), and the popstate that restores the page fires AFTER the
synchronous setPage — so the restore won, dropping you back on whatever page the
channel was opened from. Opening from the feed hid it: the page it restored
happened to be the feed.
setPage already closes an open channel page and pushes a clean history entry, so
the closeChannel() call was both redundant and the bug.
This commit is contained in:
@@ -848,7 +848,9 @@ export default function App() {
|
||||
// Keep the rest of the feed's filters — the point is "this channel, the way I
|
||||
// normally read": unwatched, my tags, my date window.
|
||||
setFilters({ ...filters, channelIds: [channelView.id] });
|
||||
closeChannel();
|
||||
// setPage already leaves an open channel page and pushes a clean history entry.
|
||||
// Calling closeChannel() first ran history.back(), whose popstate landed AFTER this
|
||||
// and restored whatever page the channel had been opened from.
|
||||
setPage("feed");
|
||||
}}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user