Skip to content

Commit

Permalink
fix: retry button reloads website and handle 429 on more places
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAkbal committed Jul 31, 2024
1 parent 2452fc0 commit 9c16416
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
10 changes: 10 additions & 0 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@
toast.error('No tags found for query "' + tag + '"')
break
case 429:
toast.error(response.statusText, {
description: 'You sent too many requests in a short period of time',
action: {
label: 'Verify I am not a Bot',
onClick: () => window.open(config.public.API_URL + '/status', '_blank')
}
})
break
default:
toast.error(`Failed to load tags: "${response.message}"`)
break
Expand Down
18 changes: 16 additions & 2 deletions pages/posts/[domain].vue
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,16 @@
toast.error('No tags found for query "' + tag + '"')
break
case 429:
toast.error(response.statusText, {
description: 'You sent too many requests in a short period of time',
action: {
label: 'Verify I am not a Bot',
onClick: () => window.open(config.public.API_URL + '/status', '_blank')
}
})
break
default:
toast.error(`Failed to load tags: "${response.message}"`)
break
Expand Down Expand Up @@ -484,6 +494,10 @@
window.location.reload()
}
function onRetryClick() {
window.location.reload()
}
const completeTitle = computed(() => {
let title = ''
Expand Down Expand Up @@ -761,7 +775,7 @@
<button
class="focus-visible:focus-outline-util hover:hover-bg-util hover:hover-text-util mx-auto mt-6 block w-fit rounded-md px-6 py-1.5 text-base ring-1 ring-base-0/20 focus-visible:ring-offset-2"
type="button"
@click="refetch()"
@click="onRetryClick"
>
Retry
</button>
Expand All @@ -775,7 +789,7 @@

<h3>No results</h3>

<span class="text-base">Try changing the domain or the tags</span>
<span class="text-base">Try changing the tags or filters</span>
</div>
</template>

Expand Down

0 comments on commit 9c16416

Please sign in to comment.