mirror of
https://github.com/hoornet/vega.git
synced 2026-04-24 06:40:01 -07:00
Preserve feed scroll position across navigation
Keep Feed component mounted (hidden via CSS) instead of unmounting when navigating to threads/profiles/etc. Back button now returns to the exact scroll position in the feed.
This commit is contained in:
@@ -62,7 +62,9 @@ function App() {
|
||||
<div className="flex flex-1 min-h-0">
|
||||
<Sidebar />
|
||||
<main className="flex-1 min-w-0">
|
||||
{currentView === "feed" && <Feed />}
|
||||
<div className={currentView === "feed" ? "contents" : "hidden"}>
|
||||
<Feed />
|
||||
</div>
|
||||
{currentView === "search" && <SearchView />}
|
||||
{currentView === "relays" && <RelaysView />}
|
||||
{currentView === "settings" && <SettingsView />}
|
||||
|
||||
@@ -24,6 +24,7 @@ export function Feed() {
|
||||
connect().then(() => loadFeed());
|
||||
}, []);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (tab === "following" && loggedIn && follows.length > 0) {
|
||||
loadFollowFeed();
|
||||
|
||||
Reference in New Issue
Block a user