Misc bugs 4 (#381)

* bug fixes

* fixed jres being undetected

* cleanup

* prettier

* fixed folders not displaying windows exporting

* fixes, more bugs

* missed function

* clippy, fmt

* prettier
This commit is contained in:
Wyatt Verchere
2023-07-28 19:56:49 -07:00
committed by GitHub
parent 744d11f09e
commit 87449f91c3
22 changed files with 171 additions and 78 deletions

View File

@@ -51,7 +51,7 @@
<Button
v-tooltip="'Open instance folder'"
class="instance-button"
@click="showInFolder(instance.path)"
@click="showProfileInFolder(instance.path)"
>
<FolderOpenIcon />
Folder
@@ -148,7 +148,7 @@ import { process_listener, profile_listener } from '@/helpers/events'
import { useRoute, useRouter } from 'vue-router'
import { ref, onUnmounted } from 'vue'
import { handleError, useBreadcrumbs, useLoading } from '@/store/state'
import { showInFolder } from '@/helpers/utils.js'
import { showProfileInFolder } from '@/helpers/utils.js'
import ContextMenu from '@/components/ui/ContextMenu.vue'
import mixpanel from 'mixpanel-browser'
import { PackageIcon } from '@/assets/icons/index.js'
@@ -268,7 +268,7 @@ const handleOptionsClick = async (args) => {
})
break
case 'open_folder':
await showInFolder(instance.value.path)
await showProfileInFolder(instance.value.path)
break
case 'copy_path':
await navigator.clipboard.writeText(instance.value.path)

View File

@@ -223,7 +223,11 @@
:checked="!mod.disabled"
@change="toggleDisableMod(mod)"
/>
<Button v-tooltip="`Show ${mod.file_name}`" icon-only @click="showInFolder(mod.path)">
<Button
v-tooltip="`Show ${mod.file_name}`"
icon-only
@click="showProfileInFolder(mod.path)"
>
<FolderOpenIcon />
</Button>
</div>
@@ -345,7 +349,7 @@ import mixpanel from 'mixpanel-browser'
import { open } from '@tauri-apps/api/dialog'
import { listen } from '@tauri-apps/api/event'
import { convertFileSrc } from '@tauri-apps/api/tauri'
import { showInFolder } from '@/helpers/utils.js'
import { showProfileInFolder } from '@/helpers/utils.js'
import { MenuIcon, ToggleIcon, TextInputIcon, AddProjectImage } from '@/assets/icons'
const router = useRouter()
@@ -605,17 +609,39 @@ const updateProject = async (mod) => {
})
}
let locks = {}
const toggleDisableMod = async (mod) => {
mod.path = await toggle_disable_project(props.instance.path, mod.path).catch(handleError)
mod.disabled = !mod.disabled
mixpanel.track('InstanceProjectDisable', {
loader: props.instance.metadata.loader,
game_version: props.instance.metadata.game_version,
id: mod.id,
name: mod.name,
project_type: mod.project_type,
disabled: mod.disabled,
})
// Use mod's id as the key for the lock. If mod doesn't have a unique id, replace `mod.id` with some unique property.
if (!locks[mod.id]) {
locks[mod.id] = ref(null)
}
let lock = locks[mod.id]
while (lock.value) {
await lock.value
}
lock.value = toggle_disable_project(props.instance.path, mod.path)
.then((newPath) => {
mod.path = newPath
mod.disabled = !mod.disabled
mixpanel.track('InstanceProjectDisable', {
loader: props.instance.metadata.loader,
game_version: props.instance.metadata.game_version,
id: mod.id,
name: mod.name,
project_type: mod.project_type,
disabled: mod.disabled,
})
})
.catch(handleError)
.finally(() => {
lock.value = null
})
await lock.value
}
const removeMod = async (mod) => {