Resolve bad setState warning in tabprovider (#1993)

pull/1994/head
shamoon 1 year ago committed by GitHub
parent cde8c658ae
commit ec1cf2f3ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -244,14 +244,16 @@ function Home({ initialSettings }) {
) )
], [settings.layout]); ], [settings.layout]);
if (!activeTab) { useEffect(() => {
const initialTab = decodeURI(asPath.substring(asPath.indexOf("#") + 1)); if (!activeTab) {
if (initialTab !== '/') { const initialTab = decodeURI(asPath.substring(asPath.indexOf("#") + 1));
setActiveTab(initialTab) if (initialTab !== '/') {
} else { setActiveTab(initialTab)
setActiveTab(tabs['0'] ?? false) } else {
setActiveTab(tabs['0'] ?? false)
}
} }
} })
const servicesAndBookmarksGroups = useMemo(() => { const servicesAndBookmarksGroups = useMemo(() => {
const tabGroupFilter = g => g && [activeTab, undefined].includes(settings.layout?.[g.name]?.tab); const tabGroupFilter = g => g && [activeTab, undefined].includes(settings.layout?.[g.name]?.tab);

Loading…
Cancel
Save