@@ -7,7 +7,7 @@ import ContentPreviewMode from '../components/ContentPreviewMode.vue'
77import { createSingleton , deepAssign , deepDelete , mergeDraft , StudioConfigFiles } from '../utils'
88import type { PreviewFile , PreviewResponse , FileChangeMessagePayload } from '../types'
99import { callWithNuxt } from '#app'
10- import { refreshNuxtData , useAppConfig , useNuxtApp , useRuntimeConfig , useState , useContentState , queryContent , ref , toRaw , useRoute , useRouter } from '#imports'
10+ import { useAppConfig , useNuxtApp , useRuntimeConfig , useState , useContentState , queryContent , ref , toRaw , useRoute , useRouter } from '#imports'
1111
1212const useDefaultAppConfig = createSingleton ( ( ) => JSON . parse ( JSON . stringify ( ( useAppConfig ( ) ) ) ) )
1313
@@ -177,9 +177,8 @@ export const useStudio = () => {
177177 }
178178 }
179179 }
180- nextTick ( ( ) => {
181- callWithNuxt ( nuxtApp , refreshNuxtData )
182- } )
180+ // Directly call `app:data:refresh` hook to refresh all data (!Calling `refreshNuxtData` causing some delay in data refresh!)
181+ await nuxtApp . hooks . callHookParallel ( 'app:data:refresh' )
183182 }
184183
185184 return {
@@ -236,7 +235,7 @@ export const useStudio = () => {
236235 } )
237236
238237 window . addEventListener ( 'message' , async ( e ) => {
239- if ( ! [ 'https://nuxt.studio' , 'https://dev.nuxt.studio' ] . includes ( e . origin ) ) {
238+ if ( ! [ 'https://nuxt.studio' , 'https://dev.nuxt.studio' , 'http://localhost:3000' ] . includes ( e . origin ) ) {
240239 return
241240 }
242241
0 commit comments