add timeout

This commit is contained in:
Jeffrey Hsu 2025-01-01 23:27:27 +08:00
parent baa263d364
commit 75167ae9e7
2 changed files with 2 additions and 2 deletions

View File

@ -6,6 +6,7 @@ export function requestCore<DataT>(url: string, options: UseFetchOptions<DataT>)
return useFetch(url, { return useFetch(url, {
baseURL: "https://cantyonion.site", baseURL: "https://cantyonion.site",
retry: false, retry: false,
timeout: 3000,
onRequest({ options }) { onRequest({ options }) {
let token: string = "" let token: string = ""
if (import.meta.client) { if (import.meta.client) {

View File

@ -73,8 +73,7 @@ const reloadActivities = async () => {
} }
} }
await reloadPosts() await Promise.all([reloadPosts(), reloadActivities()])
await reloadActivities()
onMounted(() => { onMounted(() => {
$mitt.emit('startLoading', false) $mitt.emit('startLoading', false)