Skip to content

Commit a1310dc

Browse files
staredclaude
andcommitted
Auto-execute first example on initial app load
- Make onMounted async to properly wait for WebR initialization - Execute the first example automatically once WebR is ready - Provides immediate visual feedback when app loads for the first time This ensures users see the "Getting started" example plot immediately when opening the application, improving the initial user experience. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent fa9b94c commit a1310dc

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/App.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,16 @@ const fetchGitHubStars = async () => {
165165
}
166166
}
167167
168-
onMounted(() => {
169-
// Initialize WebR without auto-executing the initial code
170-
void initializeWebR('')
168+
onMounted(async () => {
169+
// Initialize WebR first
170+
await initializeWebR('')
171171
// Fetch GitHub stars
172172
void fetchGitHubStars()
173+
174+
// Execute the first example once WebR is ready
175+
if (isReady.value && examples.length > 0) {
176+
await handleExampleSelect(examples[0])
177+
}
173178
})
174179
</script>
175180

0 commit comments

Comments
 (0)