Commit 978b0ab 1 parent 1078f23 commit 978b0ab Copy full SHA for 978b0ab
File tree 3 files changed +25
-11
lines changed
3 files changed +25
-11
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import {
13
13
updateEndTime ,
14
14
addAndGetMeetingInfo ,
15
15
getClientTranscript ,
16
+ getCurrentUser ,
16
17
} from "../../../utils/supabase" ;
17
18
import JarvisScreen from "./JarvisScreen" ;
18
19
@@ -162,8 +163,9 @@ const ActiveMeetingTab = () => {
162
163
}
163
164
164
165
async function handleTokens ( ) {
166
+ const userFound = await getCurrentUser ( ) ;
165
167
const isSet = await areTokensSet ( ) ;
166
- if ( isSet ) setLoggedIn ( true ) ;
168
+ if ( isSet && userFound ) setLoggedIn ( true ) ;
167
169
}
168
170
169
171
useEffect ( ( ) => {
@@ -381,7 +383,7 @@ const ActiveMeetingTab = () => {
381
383
) : (
382
384
< div className = "w-full flex" >
383
385
< button
384
- className = "p-2 px-4 bg-gray-500 rounded-md mx-auto"
386
+ className = "p-2 px-4 m-2 bg-gray-500 rounded-md mx-auto"
385
387
onClick = { handleLogin }
386
388
>
387
389
LogIn
Original file line number Diff line number Diff line change @@ -13,25 +13,39 @@ import {
13
13
updateEndTime ,
14
14
addAndGetMeetingInfo ,
15
15
getClientTranscript ,
16
+ getCurrentUser ,
16
17
} from "../../../utils/supabase" ;
17
18
import JarvisScreen from "./JarvisScreen" ;
18
19
import ActiveMeetingTab from "./ActiveMeetingTab" ;
19
20
20
21
const SidePanel = ( ) => {
21
22
const [ isMeetingActive , setMeetingActive ] = useState < boolean > ( true ) ;
23
+ const [ loggedIn , setLoggedIn ] = useState ( false ) ;
24
+
25
+ useEffect ( ( ) => {
26
+ handleTokens ( ) ;
27
+ } , [ ] ) ;
28
+
29
+ async function handleTokens ( ) {
30
+ const userFound = await getCurrentUser ( ) ;
31
+ const isSet = await areTokensSet ( ) ;
32
+ if ( isSet && userFound ) setLoggedIn ( true ) ;
33
+ }
22
34
23
35
if ( isMeetingActive ) {
24
36
return (
25
37
< div >
26
- < PlaybookDropdown />
38
+ { loggedIn ? < PlaybookDropdown /> : null }
27
39
< ActiveMeetingTab />
28
40
< div className = "max-w-full w-full fixed bottom-0 p-2" >
29
- < button
30
- onClick = { ( ) => setMeetingActive ( false ) }
31
- className = "bg-red-500 text-white py-2 rounded-lg w-full"
32
- >
33
- End meeting
34
- </ button >
41
+ { loggedIn ? (
42
+ < button
43
+ onClick = { ( ) => setMeetingActive ( false ) }
44
+ className = "bg-red-500 text-white py-2 rounded-lg w-full"
45
+ >
46
+ End meeting
47
+ </ button >
48
+ ) : null }
35
49
</ div >
36
50
</ div >
37
51
) ;
Original file line number Diff line number Diff line change @@ -131,8 +131,6 @@ export async function getCurrentUser(): Promise<null | User> {
131
131
async ( result ) => {
132
132
const authAccessToken = result [ "accessToken" ] ;
133
133
const authRefreshToken = result [ "refreshToken" ] ;
134
- console . log ( "authAccessToken" , authAccessToken ) ;
135
- console . log ( "authRefreshToken" , authRefreshToken ) ;
136
134
if ( authRefreshToken && authAccessToken ) {
137
135
try {
138
136
// set user session from access_token and refresh_token
You can’t perform that action at this time.
0 commit comments