@@ -4,13 +4,11 @@ import { getAuthToken, getAuthTokenWalletAddress } from "@/api/auth-token";
44import { getProjects } from "@/api/project/projects" ;
55import { fetchEcosystemList } from "@/api/team/ecosystems" ;
66import { getTeamBySlug , getTeams } from "@/api/team/get-team" ;
7- import { getChainSubscriptions } from "@/api/team/team-subscription" ;
87import { CustomChatButton } from "@/components/chat/CustomChatButton" ;
98import { AnnouncementBanner } from "@/components/misc/AnnouncementBanner" ;
109import { SidebarProvider } from "@/components/ui/sidebar" ;
1110import { siwaExamplePrompts } from "@/constants/siwa-example-prompts" ;
1211import { getClientThirdwebClient } from "@/constants/thirdweb-client.client" ;
13- import { getChain } from "../../../(dashboard)/(chain)/utils" ;
1412import { TeamHeaderLoggedIn } from "../../components/TeamHeader/team-header-logged-in.client" ;
1513import { StaffModeNotice } from "./_components/StaffModeNotice" ;
1614import { TeamSidebarLayout } from "./TeamSidebarLayout" ;
@@ -21,52 +19,26 @@ export default async function TeamLayout(props: {
2119} ) {
2220 const params = await props . params ;
2321
24- const [
25- accountAddress ,
26- account ,
27- teams ,
28- authToken ,
29- team ,
30- ecosystems ,
31- chainSubscriptions ,
32- ] = await Promise . all ( [
33- getAuthTokenWalletAddress ( ) ,
34- getValidAccount ( `/team/${ params . team_slug } ` ) ,
35- getTeams ( ) ,
36- getAuthToken ( ) ,
37- getTeamBySlug ( params . team_slug ) ,
38- fetchEcosystemList ( params . team_slug ) ,
39- getChainSubscriptions ( params . team_slug ) ,
40- ] ) ;
22+ const [ accountAddress , account , teams , authToken , team , ecosystems ] =
23+ await Promise . all ( [
24+ getAuthTokenWalletAddress ( ) ,
25+ getValidAccount ( `/team/${ params . team_slug } ` ) ,
26+ getTeams ( ) ,
27+ getAuthToken ( ) ,
28+ getTeamBySlug ( params . team_slug ) ,
29+ fetchEcosystemList ( params . team_slug ) ,
30+ ] ) ;
4131
4232 if ( ! teams || ! accountAddress || ! authToken || ! team ) {
4333 redirect ( "/login" ) ;
4434 }
4535
46- const [ teamsAndProjects , chainSidebarLinks ] = await Promise . all ( [
47- Promise . all (
48- teams . map ( async ( team ) => ( {
49- projects : await getProjects ( team . slug ) ,
50- team,
51- } ) ) ,
52- ) ,
53- chainSubscriptions
54- ? await Promise . all (
55- chainSubscriptions . map ( async ( chainSubscription ) => {
56- if ( ! chainSubscription . chainId ) {
57- throw new Error ( "Chain ID is required" ) ;
58- }
59- const chain = await getChain ( chainSubscription . chainId ) ;
60-
61- return {
62- chainId : chain . chainId ,
63- chainName : chain . name ,
64- slug : chain . slug ,
65- } ;
66- } ) ,
67- ) . catch ( ( ) => [ ] )
68- : [ ] ,
69- ] ) ;
36+ const teamsAndProjects = await Promise . all (
37+ teams . map ( async ( team ) => ( {
38+ projects : await getProjects ( team . slug ) ,
39+ team,
40+ } ) ) ,
41+ ) ;
7042
7143 const client = getClientThirdwebClient ( {
7244 jwt : authToken ,
@@ -92,9 +64,6 @@ export default async function TeamLayout(props: {
9264 </ div >
9365
9466 < TeamSidebarLayout
95- chainSubscriptions = { chainSidebarLinks . sort (
96- ( a , b ) => a . chainId - b . chainId ,
97- ) }
9867 ecosystems = { ecosystems . map ( ( ecosystem ) => ( {
9968 name : ecosystem . name ,
10069 slug : ecosystem . slug ,
0 commit comments