Finalize 0.8.1 release (#2182)

* Finalize 0.8.1 release

* Remove console.logs

* Fix build

* add default to users

* update release conf

* fix again?

* fix build (again)

* actually fix build

* Update config dir

* Update config dir

* Fix dir again
This commit is contained in:
Geometrically
2024-08-20 17:53:14 -07:00
committed by GitHub
parent 3fca24e6fd
commit a19ce0458a
25 changed files with 504 additions and 117 deletions

View File

@@ -101,7 +101,17 @@ onUnmounted(() => unlisten())
/>
<div class="project-info">
<p class="title">{{ props.instance.name }}</p>
<p class="description">
<p
v-if="
props.instance.install_stage === 'installing' ||
props.instance.install_stage === 'not_installed' ||
props.instance.install_stage === 'pack_installing'
"
class="description"
>
Installing...
</p>
<p v-else class="description">
{{ props.instance.loader }}
{{ props.instance.game_version }}
</p>

View File

@@ -0,0 +1,23 @@
<script setup lang="ts">
import { ref } from 'vue'
import { Promotion } from '@modrinth/ui'
import { get as getCreds } from '@/helpers/mr_auth.js'
import { handleError } from '@/store/notifications.js'
import { get_user } from '@/helpers/cache.js'
const showAd = ref(true)
const creds = await getCreds().catch(handleError)
if (creds && creds.user_id) {
const user = await get_user(creds.user_id).catch(handleError)
const MIDAS_BITFLAG = 1 << 0
if (user && (user.badges & MIDAS_BITFLAG) === MIDAS_BITFLAG) {
showAd.value = false
}
}
</script>
<template>
<Promotion v-if="showAd" :external="false" query-param="?r=launcher" />
</template>

View File

@@ -6,7 +6,6 @@ import {
Checkbox,
Button,
DropdownSelect,
Promotion,
NavRow,
Card,
SearchFilter,
@@ -23,6 +22,8 @@ import { get as getInstance, get_projects as getInstanceProjects } from '@/helpe
import { convertFileSrc } from '@tauri-apps/api/tauri'
import { get_search_results } from '@/helpers/cache.js'
import { debounce } from '@/helpers/utils.js'
import PromotionWrapper from '@/components/ui/PromotionWrapper.vue'
const router = useRouter()
const route = useRoute()
@@ -674,7 +675,7 @@ const isModProject = computed(() => ['modpack', 'mod'].includes(projectType.valu
</Card>
</aside>
<div class="search">
<Promotion class="promotion" :external="false" query-param="?r=launcher" />
<PromotionWrapper />
<Card class="project-type-container">
<NavRow :links="selectableProjectTypes" />
</Card>

View File

@@ -91,7 +91,6 @@ async function updateJavaVersion(version) {
async function fetchCredentials() {
const creds = await getCreds().catch(handleError)
console.log(creds)
if (creds && creds.user_id) {
creds.user = await get_user(creds.user_id).catch(handleError)
}

View File

@@ -63,7 +63,7 @@
</Card>
</div>
<div class="content">
<Promotion :external="false" query-param="?r=launcher" />
<PromotionWrapper />
<RouterView v-slot="{ Component }">
<template v-if="Component">
<Suspense @pending="loadingBar.startLoading()" @resolve="loadingBar.stopLoading()">
@@ -104,7 +104,7 @@
</ContextMenu>
</template>
<script setup>
import { Button, Avatar, Card, Promotion } from '@modrinth/ui'
import { Button, Avatar, Card } from '@modrinth/ui'
import {
BoxIcon,
SettingsIcon,
@@ -137,6 +137,7 @@ import { useFetch } from '@/helpers/fetch'
import { handleSevereError } from '@/store/error.js'
import { get_project, get_version_many } from '@/helpers/cache.js'
import dayjs from 'dayjs'
import PromotionWrapper from '@/components/ui/PromotionWrapper.vue'
const route = useRoute()

View File

@@ -213,9 +213,9 @@
class="mod-content"
>
<Avatar :src="mod.icon" />
<div v-tooltip="`${mod.name} by ${mod.author}`" class="mod-text">
<div class="mod-text">
<div class="title">{{ mod.name }}</div>
<span class="no-wrap">by {{ mod.author }}</span>
<span v-if="mod.author" class="no-wrap">by {{ mod.author }}</span>
</div>
</router-link>
<div v-else class="mod-content">
@@ -476,41 +476,54 @@ const initProjects = async (cacheBehaviour) => {
if (file.metadata) {
const project = modrinthProjects.find((x) => file.metadata.project_id === x.id)
const version = modrinthVersions.find((x) => file.metadata.version_id === x.id)
const org = project.organization
? modrinthOrganizations.find((x) => x.id === project.organization)
: null
const team = modrinthTeams.find((x) => x[0].team_id === project.team)
if (project && version) {
const org = project.organization
? modrinthOrganizations.find((x) => x.id === project.organization)
: null
let owner = org ? org.name : team.find((x) => x.is_owner).user.username
const team = modrinthTeams.find((x) => x[0].team_id === project.team)
newProjects.push({
path,
name: project.title,
slug: project.slug,
author: owner,
version: version.version_number,
file_name: file.file_name,
icon: project.icon_url,
disabled: file.file_name.endsWith('.disabled'),
updateVersion: file.update_version_id,
outdated: !!file.update_version_id,
project_type: project.project_type,
id: project.id,
})
} else {
newProjects.push({
path,
name: file.file_name.replace('.disabled', ''),
author: '',
version: null,
file_name: file.file_name,
icon: null,
disabled: file.file_name.endsWith('.disabled'),
outdated: false,
project_type: file.project_type,
})
let owner
if (org) {
owner = org.name
} else if (team) {
owner = team.find((x) => x.is_owner).user.username
} else {
owner = null
}
newProjects.push({
path,
name: project.title,
slug: project.slug,
author: owner,
version: version.version_number,
file_name: file.file_name,
icon: project.icon_url,
disabled: file.file_name.endsWith('.disabled'),
updateVersion: file.update_version_id,
outdated: !!file.update_version_id,
project_type: project.project_type,
id: project.id,
})
}
continue
}
newProjects.push({
path,
name: file.file_name.replace('.disabled', ''),
author: '',
version: null,
file_name: file.file_name,
icon: null,
disabled: file.file_name.endsWith('.disabled'),
outdated: false,
project_type: file.project_type,
})
}
projects.value = newProjects

View File

@@ -894,7 +894,8 @@ const isChanged = computed(() => {
return (
loader.value !== props.instance.loader ||
gameVersion.value !== props.instance.game_version ||
selectableLoaderVersions.value[loaderVersionIndex.value].id !== props.instance.loader_version
(loaderVersionIndex.value >= 0 &&
selectableLoaderVersions.value[loaderVersionIndex.value].id !== props.instance.loader_version)
)
})
@@ -910,6 +911,8 @@ async function saveGvLoaderEdits() {
if (loader.value !== 'vanilla') {
editProfile.loader_version = selectableLoaderVersions.value[loaderVersionIndex.value].id
} else {
loaderVersionIndex.value = -1
}
await edit(props.instance.path, editProfile).catch(handleError)
await repairProfile(false)

View File

@@ -163,7 +163,7 @@
</Card>
</div>
<div v-if="data" class="content-container">
<Promotion :external="false" query-param="?r=launcher" />
<PromotionWrapper />
<Card class="tabs">
<NavRow
v-if="data.gallery.length > 0"
@@ -261,6 +261,7 @@ import { convertFileSrc } from '@tauri-apps/api/tauri'
import ContextMenu from '@/components/ui/ContextMenu.vue'
import { install as installVersion } from '@/store/install.js'
import { get_project, get_project_many, get_team, get_version_many } from '@/helpers/cache.js'
import PromotionWrapper from '@/components/ui/PromotionWrapper.vue'
dayjs.extend(relativeTime)