You've already forked AstralRinth
forked from didirus/AstralRinth
* Initial onboarding * Update OnboardingModal.vue * Add finish * Animation * Automatic opening * Move onboarding icon to outside of main appbar * Run lint * run fmt * mostly finish * Finish onboarding * fix onboarding bug + linux build * fix build again * Add back window shadows --------- Co-authored-by: Geometrically <18202329+Geometrically@users.noreply.github.com> Co-authored-by: Jai A <jaiagr+gpg@pm.me> Co-authored-by: Jai A <jai@modrinth.com>
17 lines
451 B
JavaScript
17 lines
451 B
JavaScript
import { ofetch } from 'ofetch'
|
|
import { handleError } from '@/store/state.js'
|
|
import { getVersion } from '@tauri-apps/api/app'
|
|
|
|
export const useFetch = async (url, item) => {
|
|
try {
|
|
const version = await getVersion()
|
|
|
|
return await ofetch(url, {
|
|
headers: { 'User-Agent': `modrinth/theseus/${version} (support@modrinth.com)` },
|
|
})
|
|
} catch (err) {
|
|
handleError({ message: `Error fetching ${item}` })
|
|
console.error(err)
|
|
}
|
|
}
|