fix: global data not warming up correctly after hydration

This commit is contained in:
Zoe
2026-03-02 00:11:06 -06:00
parent 5a35976ce0
commit c84f982277
4 changed files with 26 additions and 17 deletions
+11 -9
View File
@@ -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');
}
});