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:
Geometrically
2023-06-19 14:59:06 -07:00
committed by GitHub
parent 84d731b670
commit 1e78a7b6a8
51 changed files with 1285 additions and 491 deletions

View File

@@ -5,9 +5,14 @@
description="If you proceed, all data for your instance will be removed. You will not be able to recover it."
:has-to-type="false"
proceed-label="Delete"
:noblur="!themeStore.advancedRendering"
@proceed="removeProfile"
/>
<Modal ref="changeVersionsModal" header="Change instance versions">
<Modal
ref="changeVersionsModal"
header="Change instance versions"
:noblur="!themeStore.advancedRendering"
>
<div class="change-versions-modal universal-body">
<div class="input-row">
<p class="input-label">Loader</p>
@@ -334,6 +339,8 @@ import { open } from '@tauri-apps/api/dialog'
import { get_fabric_versions, get_forge_versions, get_quilt_versions } from '@/helpers/metadata.js'
import { get_game_versions, get_loaders } from '@/helpers/tags.js'
import { handleError } from '@/store/notifications.js'
import mixpanel from 'mixpanel-browser'
import { useTheming } from '@/store/theme.js'
const router = useRouter()
@@ -344,6 +351,8 @@ const props = defineProps({
},
})
const themeStore = useTheming()
const title = ref(props.instance.metadata.name)
const icon = ref(props.instance.metadata.icon)
const groups = ref(props.instance.metadata.groups)
@@ -360,6 +369,7 @@ const availableGroups = ref([
async function resetIcon() {
icon.value = null
await edit_icon(props.instance.path, null).catch(handleError)
mixpanel.track('InstanceRemoveIcon')
}
async function setIcon() {
@@ -377,6 +387,8 @@ async function setIcon() {
icon.value = value
await edit_icon(props.instance.path, icon.value).catch(handleError)
mixpanel.track('InstanceSetIcon')
}
const globalSettings = await get().catch(handleError)
@@ -428,6 +440,7 @@ watch(
metadata: {
name: title.value.trim().substring(0, 16) ?? 'Instance',
groups: groups.value.map((x) => x.trim().substring(0, 32)).filter((x) => x.length > 0),
loader_version: props.instance.metadata.loader_version,
},
java: {},
}
@@ -481,6 +494,11 @@ async function repairProfile() {
repairing.value = true
await install(props.instance.path).catch(handleError)
repairing.value = false
mixpanel.track('InstanceRepair', {
loader: props.instance.metadata.loader,
game_version: props.instance.metadata.game_version,
})
}
const removing = ref(false)
@@ -489,6 +507,11 @@ async function removeProfile() {
await remove(props.instance.path).catch(handleError)
removing.value = false
mixpanel.track('InstanceRemove', {
loader: props.instance.metadata.loader,
game_version: props.instance.metadata.game_version,
})
await router.push({ path: '/' })
}