fix: global data not warming up correctly after hydration
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
export default defineNuxtPlugin(async () => {
|
||||
export default defineNuxtPlugin({
|
||||
name: 'global-data',
|
||||
enforce: 'pre',
|
||||
async setup() {
|
||||
await Promise.all([
|
||||
useAgents().init(),
|
||||
useModels().init(),
|
||||
useUserSettings().init()
|
||||
]);
|
||||
|
||||
// Warm up the caches
|
||||
await Promise.all([
|
||||
useAgents().init(),
|
||||
useModels().init(),
|
||||
useUserSettings().init()
|
||||
]);
|
||||
|
||||
console.log('Global data ready');
|
||||
console.log('Global data ready');
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user