@@ -52,7 +52,7 @@ const ConfigScreen = () => {
5252 } ) ;
5353
5454 const checkStatusAppAction = appActions . items . find (
55- ( action ) => action . name === 'Check Status '
55+ ( action ) => action . name === 'checkGdocOauthTokenStatus '
5656 ) ;
5757 if ( ! checkStatusAppAction ) {
5858 console . warn ( 'Check Status app action not found' ) ;
@@ -122,16 +122,14 @@ const ConfigScreen = () => {
122122
123123 const messageHandler = async ( event : MessageEvent ) => {
124124 if ( event . data . type === 'oauth:complete' ) {
125- console . log ( 'oauth:complete' ) ;
126125 const appDefinitionId = sdk . ids . app ;
127126 // call app action to complete oauth
128127 const appActions = await sdk . cma . appAction . getManyForEnvironment ( {
129128 environmentId : sdk . ids . environment ,
130129 spaceId : sdk . ids . space ,
131130 } ) ;
132- console . log ( 'appActions' , appActions ) ;
133131 const completeOauthAppAction = appActions . items . find (
134- ( action ) => action . name === 'Complete Oauth '
132+ ( action ) => action . name === 'completeGdocOauth '
135133 ) ;
136134 await sdk . cma . appActionCall . create (
137135 { appDefinitionId, appActionId : completeOauthAppAction ?. sys . id || '' } ,
@@ -142,7 +140,6 @@ const ConfigScreen = () => {
142140 } ,
143141 }
144142 ) ;
145- console . log ( 'completeOauthAppAction' , completeOauthAppAction ) ;
146143 // Check the updated status after OAuth completion - expect it to be connected
147144 await checkGoogleStatus ( true ) ;
148145
@@ -153,8 +150,6 @@ const ConfigScreen = () => {
153150 } ;
154151
155152 const cleanup = ( ) => {
156- console . log ( 'cleanup called' ) ;
157- // Clear the interval
158153 if ( checkWindowIntervalRef . current ) {
159154 window . clearInterval ( checkWindowIntervalRef . current ) ;
160155 checkWindowIntervalRef . current = null ;
@@ -184,7 +179,7 @@ const ConfigScreen = () => {
184179 } ) ;
185180
186181 const initiateOauthAppAction = appActions . items . find (
187- ( action ) => action . name === 'Initiate Oauth '
182+ ( action ) => action . name === 'initiateGdocOauth '
188183 ) ;
189184
190185 const response = await sdk . cma . appActionCall . createWithResponse (
@@ -223,7 +218,9 @@ const ConfigScreen = () => {
223218 environmentId : sdk . ids . environment ,
224219 spaceId : sdk . ids . space ,
225220 } ) ;
226- const disconnectAppAction = appActions . items . find ( ( action ) => action . name === 'Disconnect' ) ;
221+ const disconnectAppAction = appActions . items . find (
222+ ( action ) => action . name === 'revokeGdocOauthToken'
223+ ) ;
227224 await sdk . cma . appActionCall . create (
228225 {
229226 appActionId : disconnectAppAction ?. sys . id || '' ,
@@ -422,8 +419,6 @@ const ConfigScreen = () => {
422419 parameters : { } ,
423420 }
424421 ) ;
425-
426- console . log ( JSON . parse ( response . response . body ) ) ;
427422 } } >
428423 Create entries from document
429424 </ Button >
0 commit comments