From 7d02203897a1b902097866574093c9db8b4fc5b9 Mon Sep 17 00:00:00 2001 From: Jai A Date: Tue, 10 Sep 2024 01:00:29 -0700 Subject: [PATCH] Fix file paths opening --- Cargo.lock | 4 ++-- apps/app-frontend/package.json | 2 +- apps/app-frontend/src/components/ui/AddContentButton.vue | 2 +- .../app-frontend/src/components/ui/InstanceCreationModal.vue | 4 ++-- apps/app-frontend/src/components/ui/JavaSelector.vue | 5 ++--- .../src/components/ui/install_flow/ModInstallModal.vue | 2 +- apps/app-frontend/src/pages/instance/Options.vue | 2 +- apps/app/Cargo.toml | 2 +- apps/app/src/api/ads.rs | 2 +- apps/app/tauri.conf.json | 2 +- packages/app-lib/Cargo.toml | 2 +- 11 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4c982fb55..153339b98 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5684,7 +5684,7 @@ dependencies = [ [[package]] name = "theseus" -version = "0.8.6" +version = "0.8.7" dependencies = [ "async-recursion", "async-tungstenite", @@ -5735,7 +5735,7 @@ dependencies = [ [[package]] name = "theseus_gui" -version = "0.8.6" +version = "0.8.7" dependencies = [ "chrono", "cocoa 0.25.0", diff --git a/apps/app-frontend/package.json b/apps/app-frontend/package.json index 5b6b46398..e6ff3c623 100644 --- a/apps/app-frontend/package.json +++ b/apps/app-frontend/package.json @@ -1,7 +1,7 @@ { "name": "@modrinth/app-frontend", "private": true, - "version": "0.8.6", + "version": "0.8.7", "type": "module", "scripts": { "dev": "vite", diff --git a/apps/app-frontend/src/components/ui/AddContentButton.vue b/apps/app-frontend/src/components/ui/AddContentButton.vue index 2b54711e6..0673a9197 100644 --- a/apps/app-frontend/src/components/ui/AddContentButton.vue +++ b/apps/app-frontend/src/components/ui/AddContentButton.vue @@ -20,7 +20,7 @@ const handleAddContentFromFile = async () => { if (!newProject) return for (const project of newProject) { - await add_project_from_path(props.instance.path, project.path).catch(handleError) + await add_project_from_path(props.instance.path, project.path ?? project).catch(handleError) } } diff --git a/apps/app-frontend/src/components/ui/InstanceCreationModal.vue b/apps/app-frontend/src/components/ui/InstanceCreationModal.vue index c4068271c..6e3a51d19 100644 --- a/apps/app-frontend/src/components/ui/InstanceCreationModal.vue +++ b/apps/app-frontend/src/components/ui/InstanceCreationModal.vue @@ -379,7 +379,7 @@ const upload_icon = async () => { ], }) - icon.value = res ? res.path : null + icon.value = res.path ?? res if (!icon.value) return display_icon.value = convertFileSrc(icon.value) @@ -417,7 +417,7 @@ const openFile = async () => { const newProject = await open({ multiple: false }) if (!newProject) return hide() - await install_from_file(newProject.path).catch(handleError) + await install_from_file(newProject.path ?? newProject).catch(handleError) trackEvent('InstanceCreate', { source: 'CreationModalFileOpen', diff --git a/apps/app-frontend/src/components/ui/JavaSelector.vue b/apps/app-frontend/src/components/ui/JavaSelector.vue index 1a255f21c..7c113eb7e 100644 --- a/apps/app-frontend/src/components/ui/JavaSelector.vue +++ b/apps/app-frontend/src/components/ui/JavaSelector.vue @@ -127,17 +127,16 @@ async function handleJavaFileInput() { const filePath = await open() if (filePath) { - let result = await get_jre(filePath.path) + let result = await get_jre(filePath.path ?? filePath) if (!result) { result = { - path: filePath.path, + path: filePath.path ?? filePath, version: props.version.toString(), architecture: 'x86', } } trackEvent('JavaManualSelect', { - path: filePath.path, version: props.version, }) diff --git a/apps/app-frontend/src/components/ui/install_flow/ModInstallModal.vue b/apps/app-frontend/src/components/ui/install_flow/ModInstallModal.vue index 212a658eb..58e0f4ce9 100644 --- a/apps/app-frontend/src/components/ui/install_flow/ModInstallModal.vue +++ b/apps/app-frontend/src/components/ui/install_flow/ModInstallModal.vue @@ -150,7 +150,7 @@ const upload_icon = async () => { }, ], }) - icon.value = res ? res.path : null + icon.value = res.path ?? res if (!icon.value) return display_icon.value = convertFileSrc(icon.value) diff --git a/apps/app-frontend/src/pages/instance/Options.vue b/apps/app-frontend/src/pages/instance/Options.vue index 88cadbd05..2089fafe8 100644 --- a/apps/app-frontend/src/pages/instance/Options.vue +++ b/apps/app-frontend/src/pages/instance/Options.vue @@ -581,7 +581,7 @@ async function setIcon() { if (!value) return - icon.value = value.path + icon.value = value.path ?? value await edit_icon(props.instance.path, icon.value).catch(handleError) trackEvent('InstanceSetIcon') diff --git a/apps/app/Cargo.toml b/apps/app/Cargo.toml index 8e7fc2616..bb7cb476c 100644 --- a/apps/app/Cargo.toml +++ b/apps/app/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "theseus_gui" -version = "0.8.6" +version = "0.8.7" description = "The Modrinth App is a desktop application for managing your Minecraft mods" license = "GPL-3.0-only" repository = "https://github.com/modrinth/code/apps/app/" diff --git a/apps/app/src/api/ads.rs b/apps/app/src/api/ads.rs index dd76d1d51..70cbf061f 100644 --- a/apps/app/src/api/ads.rs +++ b/apps/app/src/api/ads.rs @@ -18,7 +18,7 @@ pub fn init() -> TauriPlugin { position: None, })); - /// We refresh the ads window every 5 minutes for performance + // We refresh the ads window every 5 minutes for performance let app = app.clone(); tauri::async_runtime::spawn(async move { loop { diff --git a/apps/app/tauri.conf.json b/apps/app/tauri.conf.json index 7f5ce9771..c97bddd66 100644 --- a/apps/app/tauri.conf.json +++ b/apps/app/tauri.conf.json @@ -52,7 +52,7 @@ ] }, "productName": "Modrinth App", - "version": "0.8.6", + "version": "0.8.7", "identifier": "ModrinthApp", "plugins": { "deep-link": { diff --git a/packages/app-lib/Cargo.toml b/packages/app-lib/Cargo.toml index 68d35e28e..fcd8b4323 100644 --- a/packages/app-lib/Cargo.toml +++ b/packages/app-lib/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "theseus" -version = "0.8.6" +version = "0.8.7" authors = ["Jai A "] edition = "2021"