mirror of
https://github.com/dergigi/boris.git
synced 2026-01-19 06:44:23 +01:00
fix(me): derive activeTab directly from route prop to update instantly on navigation
This commit is contained in:
@@ -291,7 +291,7 @@ const Explore: React.FC<ExploreProps> = ({ relayPool, eventStore, settings, acti
|
||||
} finally {
|
||||
// loading is already turned off after seeding
|
||||
}
|
||||
}, [relayPool, activeAccount, eventStore, settings, visibility.nostrverse, followedPubkeys])
|
||||
}, [relayPool, activeAccount, eventStore, visibility.nostrverse])
|
||||
|
||||
useEffect(() => {
|
||||
loadData()
|
||||
|
||||
@@ -57,7 +57,7 @@ const Me: React.FC<MeProps> = ({
|
||||
const activeAccount = Hooks.useActiveAccount()
|
||||
const navigate = useNavigate()
|
||||
const { filter: urlFilter } = useParams<{ filter?: string }>()
|
||||
const [activeTab, setActiveTab] = useState<TabType>(propActiveTab || 'highlights')
|
||||
const activeTab: TabType = propActiveTab || 'highlights'
|
||||
|
||||
// Only for own profile
|
||||
const viewingPubkey = activeAccount?.pubkey
|
||||
@@ -129,12 +129,7 @@ const Me: React.FC<MeProps> = ({
|
||||
}
|
||||
}, [])
|
||||
|
||||
// Update local state when prop changes
|
||||
useEffect(() => {
|
||||
if (propActiveTab) {
|
||||
setActiveTab(propActiveTab)
|
||||
}
|
||||
}, [propActiveTab])
|
||||
// activeTab is derived from route prop; no local sync needed
|
||||
|
||||
// Sync filter state with URL changes
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user