feat: complete hosted mod sync and launcher interface updates
Axolotl desktop CI / guardrails (push) Has been cancelled
Axolotl desktop CI / desktop (macos-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (ubuntu-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (windows-latest) (push) Has been cancelled
Axolotl desktop CI / website (push) Has been cancelled
Repository checks / typos (push) Has been cancelled
Repository checks / tombi (push) Has been cancelled
Rust checks / shear (push) Has been cancelled
Sync source to CNB / Sync Git ref (push) Has been cancelled

Add pack sync markers, tagged mod updates, parallel progress, JWT downloads and retry recovery. Include pending onboarding, about scene, compatibility data pack and download fixes.
This commit is contained in:
Disy committed 2026-09-15 19:06:56 +08:00
1 parent 5d473ebfbc
commit bc904065c3
63 files changed
+3516 -1059

No files matched your search

@@ -0,0 +1,56 @@
import { ref } from 'vue'
import { invoke } from '@tauri-apps/api/core'
import { hostedCreate, hostedSync } from '../helpers/hosted-packs.ts'
const installing = ref(false)
const installError = ref('')
const createdInstance = ref<string>()
const completed = ref(false)
let generation = 0
export function forgetHostedCreation(instanceId: string) {
if (createdInstance.value !== instanceId) return
generation++
createdInstance.value = undefined
completed.value = false
installError.value = ''
}
export function useHostedCreation() {
function acknowledge(instanceId: string) {
if (completed.value && createdInstance.value === instanceId) {
createdInstance.value = undefined
completed.value = false
}
}
async function install() {
if (installing.value) return
installing.value = true
installError.value = ''
const attempt = generation
try {
if (createdInstance.value) {
const instance = await invoke<unknown | null>('plugin:instance|instance_get', {
instanceId: createdInstance.value,
})
if (attempt !== generation) return
if (!instance) {
createdInstance.value = undefined
completed.value = false
}
}
if (completed.value) return createdInstance.value
createdInstance.value ??= await hostedCreate()
const instanceId = createdInstance.value
await hostedSync(instanceId)
if (attempt !== generation) return
completed.value = true
return instanceId
} catch (cause) {
if (attempt === generation) installError.value = String(cause)
} finally {
installing.value = false
}
}
return { installing, installError, createdInstance, completed, acknowledge, install }
}