diff --git a/packages/www/src/pages/steam/index.tsx b/packages/www/src/pages/steam/index.tsx index 85e8bfb3..9626d911 100644 --- a/packages/www/src/pages/steam/index.tsx +++ b/packages/www/src/pages/steam/index.tsx @@ -9,51 +9,50 @@ import { useAccount, useStorage } from "@nestri/www/providers/account"; export const SteamRoute = ( { - // const params = useParams(); - // const account = useAccount(); - // const storage = useStorage(); - // const openauth = useOpenAuth(); + component={(props) => { + const params = useParams(); + const account = useAccount(); + const storage = useStorage(); + const openauth = useOpenAuth(); - // const team = createMemo(() => - // account.current.teams.find( - // (item) => item.id === params.steamID, - // ), - // ); + const steam = createMemo(() => + account.current.profiles.find( + (item) => item.id === params.steamID, + ), + ); - // createEffect(() => { - // const t = team(); - // if (!t) return; - // storage.set("steam", t.id); - // }); + createEffect(() => { + const t = steam(); + if (!t) return; + storage.set("steam", t.id); + }); - // createEffect(() => { - // const steamID = params.steamID; - // for (const item of Object.values(account.all)) { - // for (const profile of item.profiles) { - // if (profile.id === steamID && item.id !== openauth.subject!.id) { - // openauth.switch(item.id); - // } - // } - // } - // }) + createEffect(() => { + const steamID = params.steamID; + for (const item of Object.values(account.all)) { + for (const profile of item.profiles) { + if (profile.id === steamID && item.id !== openauth.subject!.id) { + openauth.switch(item.id); + } + } + } + }) - // return ( - // - // - // {/* TODO: Add a public page for (other) teams */} - // - // - // - // team()!}> - // - // {props.children} - // - // - // - // - // ) - // }} + return ( + + + + + + steam()!}> + + {props.children} + + + + + ) + }} > } />