Skip to content

Commit

Permalink
fix: restore server
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Feb 27, 2024
1 parent d58bcab commit 37b944b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ if (!userId.value) {
userId.value = Math.random().toString(36).substring(7);
}
const res = await $fetch("/api/messages")
messages.value.push(...res.messages)
if (!messages.value.length) {
const res = await $fetch("/api/messages")
messages.value.push(...res.messages)
}
const log = (user: string, ...args: string[]) => {
console.log("[ws]", user, ...args);
Expand Down

0 comments on commit 37b944b

Please sign in to comment.