You've already forked AstralRinth
forked from didirus/AstralRinth
Initial bug fixes (#127)
* Initial bug fixes * fix compile error on non-mac * Fix even more bugs * Fix more * fix more * fix build * fix build * address review comments
This commit is contained in:
@@ -28,6 +28,10 @@ export async function authenticate_await_completion() {
|
||||
return await invoke('auth_authenticate_await_completion')
|
||||
}
|
||||
|
||||
export async function cancel_flow() {
|
||||
return await invoke('auth_cancel_flow')
|
||||
}
|
||||
|
||||
/// Refresh some credentials using Hydra, if needed
|
||||
/// user is UUID
|
||||
/// update_name is bool
|
||||
|
||||
@@ -6,5 +6,6 @@ export const useFetch = async (url, item) => {
|
||||
return await ofetch(url)
|
||||
} catch (err) {
|
||||
handleError({ message: `Error fetching ${item}` })
|
||||
console.error(err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
import { invoke } from '@tauri-apps/api/tauri'
|
||||
|
||||
// Installs pack from a version ID
|
||||
export async function install(versionId, packTitle, packIcon) {
|
||||
return await invoke('pack_install_version_id', { versionId, packTitle, packIcon })
|
||||
export async function install(projectId, versionId, packTitle, packIcon) {
|
||||
return await invoke('pack_install_version_id', { projectId, versionId, packTitle, packIcon })
|
||||
}
|
||||
|
||||
// Installs pack from a path
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
import { add_project_from_version as installMod, check_installed } from '@/helpers/profile'
|
||||
import { useFetch } from '@/helpers/fetch.js'
|
||||
import { handleError } from '@/store/notifications.js'
|
||||
import { invoke } from '@tauri-apps/api/tauri'
|
||||
|
||||
export async function showInFolder(path) {
|
||||
return await invoke('show_in_folder', { path })
|
||||
}
|
||||
|
||||
export const releaseColor = (releaseType) => {
|
||||
switch (releaseType) {
|
||||
@@ -17,11 +22,20 @@ export const releaseColor = (releaseType) => {
|
||||
|
||||
export const installVersionDependencies = async (profile, version) => {
|
||||
for (const dep of version.dependencies) {
|
||||
if (dep.dependency_type !== 'required') continue
|
||||
if (dep.version_id) {
|
||||
if (await check_installed(profile.path, dep.project_id).catch(handleError)) continue
|
||||
if (
|
||||
dep.project_id &&
|
||||
(await check_installed(profile.path, dep.project_id).catch(handleError))
|
||||
)
|
||||
continue
|
||||
await installMod(profile.path, dep.version_id)
|
||||
} else {
|
||||
if (await check_installed(profile.path, dep.project_id).catch(handleError)) continue
|
||||
if (
|
||||
dep.project_id &&
|
||||
(await check_installed(profile.path, dep.project_id).catch(handleError))
|
||||
)
|
||||
continue
|
||||
const depVersions = await useFetch(
|
||||
`https://api.modrinth.com/v2/project/${dep.project_id}/version`,
|
||||
'dependency versions'
|
||||
|
||||
Reference in New Issue
Block a user