fix(me): use propActiveTab directly to avoid infinite update loop

This commit is contained in:
Gigi
2025-10-21 23:07:51 +02:00
parent 33a31df2b4
commit 6c2247249a

View File

@@ -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 = propActiveTab || 'highlights'
// Only for own profile
const viewingPubkey = activeAccount?.pubkey
@@ -129,13 +129,6 @@ const Me: React.FC<MeProps> = ({
}
}, [])
// Sync activeTab from prop when route changes
useEffect(() => {
if (propActiveTab) {
setActiveTab(propActiveTab)
}
}, [propActiveTab])
// Sync filter state with URL changes
useEffect(() => {
const normalized = urlFilter === 'emoji' ? 'archive' : urlFilter