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)

View File

@@ -19,7 +19,7 @@ theseus = { path = "../../packages/app-lib", features = ["tauri"] }
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.7.1", features = ["app-all", "devtools", "dialog", "dialog-confirm", "dialog-open", "macos-private-api", "os-all", "protocol-asset", "shell-open", "window-close", "window-create", "window-hide", "window-maximize", "window-minimize", "window-set-decorations", "window-show", "window-start-dragging", "window-unmaximize", "window-unminimize"] }
tauri = { version = "1.7.1", features = [ "updater", "app-all", "devtools", "dialog", "dialog-confirm", "dialog-open", "macos-private-api", "os-all", "protocol-asset", "shell-open", "window-close", "window-create", "window-hide", "window-maximize", "window-minimize", "window-set-decorations", "window-show", "window-start-dragging", "window-unmaximize", "window-unminimize"] }
tauri-plugin-single-instance = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" }
tauri-plugin-window-state = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" }
tauri-plugin-deep-link = "0.1.2"

View File

@@ -3,7 +3,7 @@
windows_subsystem = "windows"
)]
use tauri::Manager;
use tauri::{Manager, PhysicalSize};
use theseus::prelude::*;
mod api;
@@ -33,6 +33,14 @@ fn show_window(app: tauri::AppHandle) {
let win = app.get_window("main").unwrap();
win.show().unwrap();
win.set_focus().unwrap();
// fix issue where window shows as extremely small
if let Ok(size) = win.inner_size() {
let width = if size.width < 1100 { 1280 } else { size.width };
let height = if size.height < 700 { 800 } else { size.height };
win.set_size(PhysicalSize::new(width, height)).unwrap();
}
}
#[tauri::command]

View File

@@ -0,0 +1,10 @@
{
"tauri": {
"updater": {
"active": true,
"endpoints": ["https://launcher-files.modrinth.com/updates.json"],
"dialog": true,
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDIwMzM5QkE0M0FCOERBMzkKUldRNTJyZzZwSnN6SUdPRGdZREtUUGxMblZqeG9OVHYxRUlRTzJBc2U3MUNJaDMvZDQ1UytZZmYK"
}
}
}

View File

@@ -8,7 +8,7 @@
},
"package": {
"productName": "Modrinth App",
"version": "0.8.0"
"version": "0.8.1"
},
"tauri": {
"allowlist": {

View File

@@ -73,9 +73,7 @@
<SparklesIcon class="h-8 w-8 text-purple" />
<span class="text-lg font-bold">Remove all ads</span>
<span class="leading-5 text-secondary">
Never see an advertisement again on
<!--the Modrinth app or-->
the website.
Never see an advertisement again on the Modrinth app or the website.
</span>
</div>
<div class="flex flex-col gap-4 rounded-xl bg-bg-raised p-4">

View File

@@ -34,10 +34,7 @@
<span class="font-bold">Benefits</span>
<div class="flex items-center gap-2">
<CheckCircleIcon class="h-5 w-5 text-brand" />
<span>
Ad-free browsing on modrinth.com
<!--and Modrinth App-->
</span>
<span> Ad-free browsing on modrinth.com and Modrinth App </span>
</div>
<div class="flex items-center gap-2">
<CheckCircleIcon class="h-5 w-5 text-brand" />