mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-06 20:28:48 +00:00
Resolve bad setState warning in tabprovider (#1993)
This commit is contained in:
parent
cde8c658ae
commit
ec1cf2f3ca
1 changed files with 9 additions and 7 deletions
|
@ -244,14 +244,16 @@ function Home({ initialSettings }) {
|
|||
)
|
||||
], [settings.layout]);
|
||||
|
||||
if (!activeTab) {
|
||||
const initialTab = decodeURI(asPath.substring(asPath.indexOf("#") + 1));
|
||||
if (initialTab !== '/') {
|
||||
setActiveTab(initialTab)
|
||||
} else {
|
||||
setActiveTab(tabs['0'] ?? false)
|
||||
useEffect(() => {
|
||||
if (!activeTab) {
|
||||
const initialTab = decodeURI(asPath.substring(asPath.indexOf("#") + 1));
|
||||
if (initialTab !== '/') {
|
||||
setActiveTab(initialTab)
|
||||
} else {
|
||||
setActiveTab(tabs['0'] ?? false)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const servicesAndBookmarksGroups = useMemo(() => {
|
||||
const tabGroupFilter = g => g && [activeTab, undefined].includes(settings.layout?.[g.name]?.tab);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue