Skip to content

Commit b78dfa7

Browse files
committed
chore: playground fixes
1 parent 21340b0 commit b78dfa7

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

Diff for: packages/nuxt/playground/pages/firestore-secure-doc.vue

+11-11
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@ import { doc, setDoc } from 'firebase/firestore'
33
import { useCurrentUser, useFirestore, usePendingPromises } from 'vuefire'
44
55
definePageMeta({
6-
middleware: ['vuefire-auth']
6+
middleware: ['vuefire-auth'],
77
})
88
99
const db = useFirestore()
1010
const user = useCurrentUser()
11-
const secretRef = computed(() => user.value ? doc(db, 'secrets', user.value.uid) : null)
11+
const secretRef = computed(() =>
12+
user.value ? doc(db, 'secrets', user.value.uid) : null
13+
)
1214
13-
const { data:secret, pending: isSecretLoading } = useDocument(secretRef)
15+
const { data: secret, pending: isSecretLoading } = useDocument(secretRef)
1416
1517
const textSecret = ref('')
1618
function setSecret() {
@@ -22,22 +24,20 @@ function setSecret() {
2224

2325
<template>
2426
<div>
25-
<p v-if="!user">
26-
Log in in the authentication page to test this.
27-
</p>
28-
<template v-else-if="secret">
27+
<p v-if="!user">Log in in the authentication page to test this.</p>
28+
<template v-else-if="isSecretLoading">
29+
<p>Loading...</p>
30+
</template>
31+
<template v-else>
2932
<p>Secret Data for user {{ user.displayName }} ({{ user.uid }})</p>
3033
<pre v-if="secret">{{ secret }}</pre>
3134
<div v-else>
3235
<p>You have no secret. Do you want to create one?</p>
3336
<form @submit.prevent="setSecret()">
34-
<input v-model="textSecret" type="text">
37+
<input v-model="textSecret" type="text" />
3538
<button>Set the secret</button>
3639
</form>
3740
</div>
3841
</template>
39-
<template v-else-if="isSecretLoading">
40-
<p>Loading...</p>
41-
</template>
4242
</div>
4343
</template>

0 commit comments

Comments
 (0)