Fix some small things (#658)

This commit is contained in:
Geometrically
2023-08-23 11:03:09 -04:00
committed by GitHub
parent 1eb8998296
commit 2fad02df23
12 changed files with 34 additions and 53 deletions

4
Cargo.lock generated
View File

@@ -888,9 +888,9 @@ dependencies = [
[[package]]
name = "daedalus"
version = "0.1.23"
version = "0.1.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d14d655650f5f0fd5b88946d4add0f1b02d866e40632304cfe1427240bfd2430"
checksum = "247a958ffad4a2a44fb081a2b1ef39d6b4698c179949542b202236a460102762"
dependencies = [
"bincode 2.0.0-rc.3",
"bytes",

View File

@@ -1,6 +1,6 @@
[package]
name = "theseus"
version = "0.5.3"
version = "0.5.4"
authors = ["Jai A <jaiagr+gpg@pm.me>"]
edition = "2018"
@@ -24,7 +24,7 @@ tempfile = "3.5.0"
urlencoding = "2.1.3"
chrono = { version = "0.4.19", features = ["serde"] }
daedalus = { version = "0.1.23" }
daedalus = { version = "0.1.25" }
dirs = "5.0.1"
regex = "1.5"

View File

@@ -92,7 +92,7 @@ pub async fn auto_install_java(java_version: u32) -> crate::Result<PathBuf> {
let packages = fetch_json::<Vec<Package>>(
Method::GET,
&format!(
"https://api.azul.com/metadata/v1/zulu/packages?arch={}&java_version={}&os={}&archive_type=zip&javafx_bundled=false&java_package_type=jre&page_size=1",
"https://api.azul.com/metadata/v1/zulu/packages?arch={}&java_version={}&os={}&archive_type=zip&javafx_bundled=false&java_package_type=jdk&page_size=1",
std::env::consts::ARCH, java_version, std::env::consts::OS
),
None,

View File

@@ -90,22 +90,6 @@ pub async fn login_2fa(
Ok(creds)
}
#[tracing::instrument]
pub async fn login_minecraft(
flow: &str,
) -> crate::Result<ModrinthCredentialsResult> {
let state = crate::State::get().await?;
let creds =
crate::state::login_minecraft(flow, &state.fetch_semaphore).await?;
if let ModrinthCredentialsResult::Credentials(creds) = &creds {
let mut write = state.credentials.write().await;
write.login(creds.clone()).await?;
}
Ok(creds)
}
#[tracing::instrument]
pub async fn create_account(
username: &str,

View File

@@ -1,6 +1,6 @@
[package]
name = "theseus_cli"
version = "0.5.3"
version = "0.5.4"
authors = ["Jai A <jaiagr+gpg@pm.me>"]
edition = "2018"

View File

@@ -1,7 +1,7 @@
{
"name": "theseus_gui",
"private": true,
"version": "0.5.3",
"version": "0.5.4",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,6 +1,6 @@
[package]
name = "theseus_gui"
version = "0.5.3"
version = "0.5.4"
description = "A Tauri App"
authors = ["you"]
license = ""

View File

@@ -10,7 +10,6 @@ pub fn init<R: tauri::Runtime>() -> TauriPlugin<R> {
cancel_flow,
login_pass,
login_2fa,
login_minecraft,
create_account,
refresh,
logout,
@@ -49,11 +48,6 @@ pub async fn login_2fa(code: &str, flow: &str) -> Result<ModrinthCredentials> {
Ok(theseus::mr_auth::login_2fa(code, flow).await?)
}
#[tauri::command]
pub async fn login_minecraft(flow: &str) -> Result<ModrinthCredentialsResult> {
Ok(theseus::mr_auth::login_minecraft(flow).await?)
}
#[tauri::command]
pub async fn create_account(
username: &str,

View File

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

View File

@@ -38,7 +38,17 @@ const initFiles = async () => {
.map((folder) => ({
path: folder,
name: folder.split(sep).pop(),
selected: false,
selected:
folder.startsWith('mods') ||
folder.startsWith('datapacks') ||
folder.startsWith('resourcepacks') ||
folder.startsWith('shaderpacks') ||
folder.startsWith('config'),
disabled:
folder === 'profile.json' ||
folder.startsWith('modrinth_logs') ||
folder.startsWith('.fabric') ||
folder.includes('.DS_Store'),
}))
.forEach((pathData) => {
const parent = pathData.path.split(sep).slice(0, -1).join(sep)
@@ -115,7 +125,7 @@ const exportPack = async () => {
</div>
<div class="table">
<div class="table-head">
<div class="table-cell">Select files as overrides</div>
<div class="table-cell">Select files and folders to include in pack</div>
</div>
<div class="table-content">
<div v-for="[path, children] of folders" :key="path.name" class="table-row">
@@ -125,6 +135,7 @@ const exportPack = async () => {
:model-value="children.every((child) => child.selected)"
:label="path.name"
class="select-checkbox"
:disabled="children.every((x) => x.disabled)"
@update:model-value="
(newValue) => children.forEach((child) => (child.selected = newValue))
"
@@ -137,7 +148,12 @@ const exportPack = async () => {
</div>
<div v-if="path.showingMore" class="file-secondary">
<div v-for="child in children" :key="child.path" class="file-secondary-row">
<Checkbox v-model="child.selected" :label="child.name" class="select-checkbox" />
<Checkbox
v-model="child.selected"
:label="child.name"
class="select-checkbox"
:disabled="child.disabled"
/>
</div>
</div>
</div>
@@ -145,7 +161,12 @@ const exportPack = async () => {
<div v-for="file in files" :key="file.path" class="table-row">
<div class="table-cell file-entry">
<div class="file-primary">
<Checkbox v-model="file.selected" :label="file.name" class="select-checkbox" />
<Checkbox
v-model="file.selected"
:label="file.name"
:disabled="file.disabled"
class="select-checkbox"
/>
</div>
</div>
</div>

View File

@@ -14,8 +14,6 @@ import {
login_2fa,
create_account,
login_pass,
get as getCreds,
login_minecraft,
} from '@/helpers/mr_auth.js'
import { handleError, useNotifications } from '@/store/state.js'
import { onMounted, ref } from 'vue'
@@ -33,10 +31,6 @@ const props = defineProps({
type: Boolean,
required: true,
},
flow: {
type: String,
default: null,
},
})
const loggingIn = ref(true)
@@ -118,15 +112,6 @@ async function createAccount() {
}
async function goToNextPage() {
const creds = await getCreds().catch(handleError)
if (!creds) {
try {
await login_minecraft(props.flow)
} catch {
/* empty */
}
}
props.nextPage()
}

View File

@@ -24,9 +24,6 @@ export async function login_2fa(code, flow) {
return await invoke('plugin:mr_auth|login_2fa', { code, flow })
}
export async function login_minecraft(flow) {
return await invoke('plugin:mr_auth|login_minecraft', { flow })
}
export async function create_account(username, email, password, challenge, signUpNewsletter) {
return await invoke('plugin:mr_auth|create_account', {
username,