You've already forked AstralRinth
forked from didirus/AstralRinth
fixes (#449)
* fixes * prettier * more bugs * changes * more fixes * prettier, fmt, clippy * fix regressed error * println, console.log * fix imports --------- Co-authored-by: Geometrically <18202329+Geometrically@users.noreply.github.com> Co-authored-by: Jai A <jaiagr+gpg@pm.me>
This commit is contained in:
@@ -284,7 +284,7 @@ const handleOptionsClick = async (args) => {
|
||||
}
|
||||
|
||||
const unlistenProfiles = await profile_listener(async (event) => {
|
||||
if (event.path === route.params.id) {
|
||||
if (event.profile_path_id === route.params.id) {
|
||||
if (event.event === 'removed') {
|
||||
await router.push({
|
||||
path: '/',
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<CheckIcon v-else />
|
||||
{{ copied ? 'Copied' : 'Copy' }}
|
||||
</Button>
|
||||
<Button color="primary" :disabled="offline" @click="share">
|
||||
<Button color="primary" :disabled="offline || !logs[selectedLogIndex]" @click="share">
|
||||
<ShareIcon />
|
||||
Share
|
||||
</Button>
|
||||
|
||||
@@ -336,7 +336,7 @@ import {
|
||||
ShareModal,
|
||||
CodeIcon,
|
||||
} from 'omorphia'
|
||||
import { computed, ref, watch } from 'vue'
|
||||
import { computed, onUnmounted, ref, watch } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import {
|
||||
add_project_from_path,
|
||||
@@ -353,7 +353,6 @@ import { listen } from '@tauri-apps/api/event'
|
||||
import { convertFileSrc } from '@tauri-apps/api/tauri'
|
||||
import { showProfileInFolder } from '@/helpers/utils.js'
|
||||
import { MenuIcon, ToggleIcon, TextInputIcon, AddProjectImage } from '@/assets/icons'
|
||||
import { install_from_file } from '@/helpers/pack'
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
@@ -785,18 +784,15 @@ watch(selectAll, () => {
|
||||
}
|
||||
})
|
||||
|
||||
listen('tauri://file-drop', async (event) => {
|
||||
if (event.payload && event.payload.length > 0 && event.payload[0].endsWith('.mrpack')) {
|
||||
await install_from_file(event.payload[0]).catch(handleError)
|
||||
} else {
|
||||
for (const file of event.payload) {
|
||||
await add_project_from_path(props.instance.path, file, 'mod').catch(handleError)
|
||||
}
|
||||
initProjects(await get(props.instance.path).catch(handleError))
|
||||
const unlisten = await listen('tauri://file-drop', async (event) => {
|
||||
for (const file of event.payload) {
|
||||
if (file.endsWith('.mrpack')) continue
|
||||
await add_project_from_path(props.instance.path, file, 'mod').catch(handleError)
|
||||
}
|
||||
mixpanel_track('InstanceCreate', {
|
||||
source: 'FileDrop',
|
||||
})
|
||||
initProjects(await get(props.instance.path).catch(handleError))
|
||||
})
|
||||
onUnmounted(() => {
|
||||
unlisten()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-primary"
|
||||
:disabled="!isValid || editing"
|
||||
:disabled="!isValid || !isChanged || editing"
|
||||
@click="saveGvLoaderEdits()"
|
||||
>
|
||||
<SaveIcon />
|
||||
@@ -71,7 +71,11 @@
|
||||
<UploadIcon />
|
||||
Select icon
|
||||
</button>
|
||||
<button class="btn" @click="resetIcon">
|
||||
<button
|
||||
:disabled="!(!icon || (icon && icon.startsWith('http')) ? icon : convertFileSrc(icon))"
|
||||
class="btn"
|
||||
@click="resetIcon"
|
||||
>
|
||||
<TrashIcon />
|
||||
Remove icon
|
||||
</button>
|
||||
@@ -93,8 +97,8 @@
|
||||
<button
|
||||
id="edit-versions"
|
||||
class="btn"
|
||||
@click="$refs.changeVersionsModal.show()"
|
||||
:disabled="offline"
|
||||
@click="$refs.changeVersionsModal.show()"
|
||||
>
|
||||
<EditIcon />
|
||||
Edit versions
|
||||
@@ -640,6 +644,15 @@ const isValid = computed(() => {
|
||||
)
|
||||
})
|
||||
|
||||
const isChanged = computed(() => {
|
||||
return (
|
||||
loader.value != props.instance.metadata.loader ||
|
||||
gameVersion.value != props.instance.metadata.game_version ||
|
||||
JSON.stringify(selectableLoaderVersions.value[loaderVersionIndex.value]) !=
|
||||
JSON.stringify(props.instance.metadata.loader_version)
|
||||
)
|
||||
})
|
||||
|
||||
watch(loader, () => (loaderVersionIndex.value = 0))
|
||||
|
||||
const editing = ref(false)
|
||||
|
||||
Reference in New Issue
Block a user