File tree 1 file changed +12
-10
lines changed
npm-packages/dashboard-self-hosted/src/pages
1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -369,18 +369,20 @@ function useEmbeddedDashboardCredentials(
369
369
submittedDeploymentName : string ;
370
370
} ) => void ,
371
371
) {
372
+ // Send a message to the parent iframe to request the credentials.
373
+ // This prevents race conditions where the parent iframe sends the message
374
+ // before the dashboard loads.
372
375
useEffect ( ( ) => {
373
- const handleMessage = ( event : MessageEvent ) => {
374
- // Send a message to the parent iframe to request the credentials.
375
- // This prevents race conditions where the parent iframe sends the message
376
- // before the dashboard loads.
377
- window . parent . postMessage (
378
- {
379
- type : "dashboard-credentials-request" ,
380
- } ,
381
- "*" ,
382
- ) ;
376
+ window . parent . postMessage (
377
+ {
378
+ type : "dashboard-credentials-request" ,
379
+ } ,
380
+ "*" ,
381
+ ) ;
382
+ } , [ ] ) ;
383
383
384
+ useEffect ( ( ) => {
385
+ const handleMessage = ( event : MessageEvent ) => {
384
386
const credentialsSchema = z . object ( {
385
387
type : z . literal ( "dashboard-credentials" ) ,
386
388
adminKey : z . string ( ) ,
You can’t perform that action at this time.
0 commit comments