mirror of
				https://github.com/karl0ss/homepage.git
				synced 2025-11-04 08:20:58 +00:00 
			
		
		
		
	Resolve bad setState warning in tabprovider (#1993)
This commit is contained in:
		
							parent
							
								
									cde8c658ae
								
							
						
					
					
						commit
						ec1cf2f3ca
					
				@ -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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user