@@ -10,15 +10,16 @@ import { HOME_URL } from '~envs'
1010import { useAuthStore , useProfileStore } from '~store'
1111
1212export const getServerSideProps : GetServerSideProps = async ( ctx ) => {
13- const { code, error = '' , done } = ctx . query
13+ const { username = '' , code, error = '' , done } = ctx . query
1414
15- if ( ! code )
15+ if ( ! code && ! done )
1616 return {
1717 notFound : true ,
1818 }
1919
2020 return {
2121 props : {
22+ username,
2223 code,
2324 error : decodeURIComponent ( error as string ) ,
2425 done : ! ! done ,
@@ -30,10 +31,12 @@ export default function ConnectTelegram({
3031 code,
3132 error,
3233 done,
34+ username,
3335} : {
3436 code ?: string
3537 error ?: string
3638 done : boolean
39+ username : string
3740} ) {
3841 const isLoading = useAuthStore ( ( s ) => s . isLoadingSession )
3942 const profile = useProfileStore ( ( s ) => s . me )
@@ -68,13 +71,18 @@ export default function ConnectTelegram({
6871 “{ error } ”
6972 </ div >
7073 </ div >
71- ) : hasTelegramAccount && done ? (
74+ ) : hasTelegramAccount && username && done ? (
7275 < div className = "py-8 px-8 mx-auto md:px-16 md:max-w-2xl" >
7376 < div className = "text-2xl font-black text-center md:text-3xl" >
7477 < span className = "uppercase text-mochi-gradient" >
75- Your Telegram is linked! You can close this window
78+ Your Telegram < span className = "font-mono" > @{ username } </ span > { ' ' }
79+ is linked! You can close this window
7680 </ span > { ' ' }
7781 ✨
82+ < p className = "mt-4 text-sm uppercase md:text-base" >
83+ To connect with a different account, please disconnet the
84+ mochi.gg app via the Telegram and try again.
85+ </ p >
7886 </ div >
7987 </ div >
8088 ) : (
0 commit comments