|
| 1 | +<template> |
| 2 | + <div class="bg-yellow-900 p-4 space-y-2" role="alert"> |
| 3 | + <p class="font-bold"> |
| 4 | + 😔 It seems you've blocked the Garden of Eden from accessing your dragons. |
| 5 | + </p> |
| 6 | + <p>While blocked, any dragons you add will be periodically removed.</p> |
| 7 | + <p> |
| 8 | + Even though the Garden uses your scroll authorisation, it still requires |
| 9 | + logged out access to be enabled. Don't worry, this is only used for |
| 10 | + assessing the state of your dragons and for performance reasons. |
| 11 | + </p> |
| 12 | + <p> |
| 13 | + To unblock, please press the unblock button next to "Garden of Eden" in |
| 14 | + your |
| 15 | + <NuxtLink to="https://dragcave.net/account/sessions#3rdparty" |
| 16 | + >Dragon Cave account settings</NuxtLink |
| 17 | + >, under "Logged Out Third-Party Access". |
| 18 | + </p> |
| 19 | + |
| 20 | + <button class="btn-primary" type="button" @click="checkApiBlock()"> |
| 21 | + Alright, I've unblocked. Let me in! |
| 22 | + </button> |
| 23 | + <p v-if="working">Checking...</p> |
| 24 | + <p v-else-if="failedToUnblock"> |
| 25 | + It still seems you've got the Garden blocked. Please try again. If the |
| 26 | + issue persists, |
| 27 | + <NuxtLink |
| 28 | + to="https://forums.dragcave.net/topic/189636-chazzas-dc-tools-garden-of-eden-lineage-builder-fart/" |
| 29 | + >leave a message on the forum</NuxtLink |
| 30 | + >. |
| 31 | + </p> |
| 32 | + </div> |
| 33 | +</template> |
| 34 | + |
| 35 | +<script lang="ts" setup> |
| 36 | +const failedToUnblock = ref(false); |
| 37 | +const working = ref(false); |
| 38 | +
|
| 39 | +const { data: authData } = useAuth(); |
| 40 | +
|
| 41 | +async function checkApiBlock() { |
| 42 | + if (!authData.value?.user) { |
| 43 | + return; |
| 44 | + } |
| 45 | +
|
| 46 | + working.value = true; |
| 47 | + const blocked = await $fetch<true | false>('/api/user/scroll/check'); |
| 48 | +
|
| 49 | + if (!blocked) { |
| 50 | + reloadNuxtApp(); |
| 51 | + return; |
| 52 | + } |
| 53 | +
|
| 54 | + failedToUnblock.value = true; |
| 55 | + working.value = false; |
| 56 | +} |
| 57 | +</script> |
0 commit comments