You've already forked AstralRinth
forked from didirus/AstralRinth
Analytics + more bug fixes (#144)
* Analytics + more bug fixes * debug deadlock * Fix mostly everything * merge fixes * fix rest * final fixeS
This commit is contained in:
@@ -3,7 +3,9 @@ import { handleError } from '@/store/state.js'
|
||||
|
||||
export const useFetch = async (url, item) => {
|
||||
try {
|
||||
return await ofetch(url)
|
||||
return await ofetch(url, {
|
||||
headers: { 'User-Agent': 'modrinth/theseus (support@modrinth.com)' },
|
||||
})
|
||||
} catch (err) {
|
||||
handleError({ message: `Error fetching ${item}` })
|
||||
console.error(err)
|
||||
|
||||
@@ -27,13 +27,8 @@ export async function get_logs_by_datetime(profileUuid, datetimeString) {
|
||||
}
|
||||
|
||||
/// Get a profile's stdout only by datetime_string (the folder name, when the log was created)
|
||||
export async function get_stdout_by_datetime(profileUuid, datetimeString) {
|
||||
return await invoke('logs_get_stdout_by_datetime', { profileUuid, datetimeString })
|
||||
}
|
||||
|
||||
/// Get a profile's stderr only by datetime_string (the folder name, when the log was created)
|
||||
export async function get_stderr_by_datetime(profileUuid, datetimeString) {
|
||||
return await invoke('logs_get_stderr_by_datetime', { profileUuid, datetimeString })
|
||||
export async function get_output_by_datetime(profileUuid, datetimeString) {
|
||||
return await invoke('logs_get_output_by_datetime', { profileUuid, datetimeString })
|
||||
}
|
||||
|
||||
/// Delete a profile's log by datetime_string (the folder name, when the log was created)
|
||||
|
||||
@@ -47,16 +47,10 @@ export async function get_all_running_profiles() {
|
||||
return await invoke('process_get_all_running_profiles')
|
||||
}
|
||||
|
||||
/// Gets process stderr by UUID
|
||||
/// Returns String
|
||||
export async function get_stderr_by_uuid(uuid) {
|
||||
return await invoke('process_get_stderr_by_uuid', { uuid })
|
||||
}
|
||||
|
||||
/// Gets process stdout by UUID
|
||||
/// Returns String
|
||||
export async function get_stdout_by_uuid(uuid) {
|
||||
return await invoke('process_get_stdout_by_uuid', { uuid })
|
||||
export async function get_output_by_uuid(uuid) {
|
||||
return await invoke('process_get_output_by_uuid', { uuid })
|
||||
}
|
||||
|
||||
/// Kills a process by UUID
|
||||
|
||||
@@ -3,6 +3,10 @@ import { useFetch } from '@/helpers/fetch.js'
|
||||
import { handleError } from '@/store/notifications.js'
|
||||
import { invoke } from '@tauri-apps/api/tauri'
|
||||
|
||||
export async function isDev() {
|
||||
return await invoke('is_dev')
|
||||
}
|
||||
|
||||
export async function showInFolder(path) {
|
||||
return await invoke('show_in_folder', { path })
|
||||
}
|
||||
@@ -23,6 +27,8 @@ export const releaseColor = (releaseType) => {
|
||||
export const installVersionDependencies = async (profile, version) => {
|
||||
for (const dep of version.dependencies) {
|
||||
if (dep.dependency_type !== 'required') continue
|
||||
// disallow fabric api install on quilt
|
||||
if (dep.project_id === 'P7dR8mSH' && profile.metadata.loader === 'quilt') continue
|
||||
if (dep.version_id) {
|
||||
if (
|
||||
dep.project_id &&
|
||||
@@ -45,7 +51,9 @@ export const installVersionDependencies = async (profile, version) => {
|
||||
v.game_versions.includes(profile.metadata.game_version) &&
|
||||
v.loaders.includes(profile.metadata.loader)
|
||||
)
|
||||
await installMod(profile.path, latest.id).catch(handleError)
|
||||
if (latest) {
|
||||
await installMod(profile.path, latest.id).catch(handleError)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user