@@ -3,10 +3,13 @@ import { notFound } from 'next/navigation';
33import PlateProgress from '@/app/plateProgress/components/PlateProgress' ;
44import getUserProfile from '@/utils/getUserProfile' ;
55
6- export default async ( { params } : { params : { tguid : string , type : string , profile : string } } ) => {
7- let type = decodeURIComponent ( params . type ) as typeof PLATE_TYPE [ number ] | '' ;
8- let ver : typeof PLATE_VER [ number ] | typeof BA_VE ;
9- if ( type as any === BA_VE ) {
6+ export default async (
7+ props : { params : Promise < { tguid : string , type : string , profile : string } > }
8+ ) => {
9+ const params = await props . params ;
10+ let type = decodeURIComponent ( params . type ) as typeof PLATE_TYPE [ number ] | '' ;
11+ let ver : typeof PLATE_VER [ number ] | typeof BA_VE ;
12+ if ( type as any === BA_VE ) {
1013 ver = BA_VE ;
1114 type = '' ;
1215 } else {
@@ -15,10 +18,10 @@ export default async ({ params }: { params: { tguid: string, type: string, profi
1518 if ( ! ( PLATE_VER . includes ( ver as any ) && PLATE_TYPE . includes ( type as any ) ) ) notFound ( ) ;
1619 }
1720
18- const profile = await getUserProfile ( params . tguid , params . profile ) ;
19- const profileVer = await profile . getVersion ( ) ;
20- const requiredList = ( await profile . plateSongs ( ) ) [ ver ] . map ( it => Song . fromId ( it , profileVer ) )
21- const userMusic = await profile . getUserMusic ( requiredList ) ;
21+ const profile = await getUserProfile ( params . tguid , params . profile ) ;
22+ const profileVer = await profile . getVersion ( ) ;
23+ const requiredList = ( await profile . plateSongs ( ) ) [ ver ] . map ( it => Song . fromId ( it , profileVer ) )
24+ const userMusic = await profile . getUserMusic ( requiredList ) ;
2225
23- return < PlateProgress userMusic = { userMusic } type = { type } ver = { ver } requiredList = { requiredList } logo = { await profile . getVersionLogo ( ) } /> ;
24- }
26+ return < PlateProgress userMusic = { userMusic } type = { type } ver = { ver } requiredList = { requiredList } logo = { await profile . getVersionLogo ( ) } /> ;
27+ } ;
0 commit comments