You've already forked AstralRinth
forked from didirus/AstralRinth
@@ -110,11 +110,6 @@ export async function update_repair_modrinth(path) {
|
||||
return await invoke('plugin:profile|profile_repair_managed_modrinth', { path })
|
||||
}
|
||||
|
||||
// Gets whether a profile is managed by Modrinth
|
||||
export async function is_managed_modrinth(path) {
|
||||
return await invoke('plugin:profile|profile_is_managed_modrinth', { path })
|
||||
}
|
||||
|
||||
// Export a profile to .mrpack
|
||||
/// included_overrides is an array of paths to override folders to include (ie: 'mods', 'resource_packs')
|
||||
// Version id is optional (ie: 1.1.5)
|
||||
|
||||
@@ -247,7 +247,7 @@ async function refreshSearch() {
|
||||
}
|
||||
}
|
||||
if (instanceContext.value) {
|
||||
for (let val of results.value) {
|
||||
for (let val of results.value.hits) {
|
||||
val.installed = await check_installed(instanceContext.value.path, val.project_id).then(
|
||||
(x) => (val.installed = x)
|
||||
)
|
||||
|
||||
@@ -10,9 +10,14 @@
|
||||
v-model="selectedProjectType"
|
||||
:items="Object.keys(selectableProjectTypes)"
|
||||
/>
|
||||
<Button v-if="canUpdatePack" color="secondary" @click="updateModpack">
|
||||
<Button
|
||||
v-if="canUpdatePack"
|
||||
:disabled="updatingModpack"
|
||||
color="secondary"
|
||||
@click="updateModpack"
|
||||
>
|
||||
<UpdatedIcon />
|
||||
Update modpack
|
||||
{{ updatingModpack ? 'Updating' : 'Update modpack' }}
|
||||
</Button>
|
||||
</div>
|
||||
<div class="card-row">
|
||||
@@ -362,7 +367,6 @@ import { useRouter } from 'vue-router'
|
||||
import {
|
||||
add_project_from_path,
|
||||
get,
|
||||
is_managed_modrinth,
|
||||
remove_project,
|
||||
toggle_disable_project,
|
||||
update_all,
|
||||
@@ -403,8 +407,14 @@ const props = defineProps({
|
||||
const projects = ref([])
|
||||
const selectionMap = ref(new Map())
|
||||
const showingOptions = ref(false)
|
||||
const canUpdatePack = ref(await is_managed_modrinth(props.instance.path))
|
||||
const canUpdatePack = computed(() => {
|
||||
return (
|
||||
props.instance.metadata.linked_data &&
|
||||
props.instance.metadata.linked_data.version_id !== props.instance.modrinth_update_version
|
||||
)
|
||||
})
|
||||
|
||||
console.log(props.instance)
|
||||
const initProjects = (initInstance) => {
|
||||
projects.value = []
|
||||
if (!initInstance || !initInstance.projects) return
|
||||
@@ -800,8 +810,11 @@ const handleContentOptionClick = async (args) => {
|
||||
}
|
||||
}
|
||||
|
||||
const updatingModpack = ref(false)
|
||||
const updateModpack = async () => {
|
||||
updatingModpack.value = true
|
||||
await update_managed_modrinth(props.instance.path).catch(handleError)
|
||||
updatingModpack.value = false
|
||||
}
|
||||
|
||||
watch(selectAll, () => {
|
||||
|
||||
@@ -508,7 +508,7 @@ watch(
|
||||
async () => {
|
||||
const editProfile = {
|
||||
metadata: {
|
||||
name: title.value.trim().substring(0, 16) ?? 'Instance',
|
||||
name: title.value.trim().substring(0, 32) ?? 'Instance',
|
||||
groups: groups.value.map((x) => x.trim().substring(0, 32)).filter((x) => x.length > 0),
|
||||
loader_version: props.instance.metadata.loader_version,
|
||||
linked_data: props.instance.metadata.linked_data,
|
||||
|
||||
Reference in New Issue
Block a user