From 4f9ec0e02bdc85c36a551f8bb4a35cac3a71566d Mon Sep 17 00:00:00 2001 From: Geometrically <18202329+Geometrically@users.noreply.github.com> Date: Tue, 20 Jun 2023 22:04:17 -0700 Subject: [PATCH] Fix search + linux build (#179) --- theseus/Cargo.toml | 2 +- theseus_cli/Cargo.toml | 2 +- theseus_gui/src-tauri/Cargo.toml | 1 + theseus_gui/src-tauri/src/main.rs | 17 ++++++++++------- theseus_gui/src-tauri/tauri.conf.json | 2 +- theseus_gui/src/components/ui/SearchCard.vue | 10 ++++++---- theseus_gui/src/pages/Browse.vue | 1 + 7 files changed, 21 insertions(+), 14 deletions(-) diff --git a/theseus/Cargo.toml b/theseus/Cargo.toml index 2ff28c01..c2f4029d 100644 --- a/theseus/Cargo.toml +++ b/theseus/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "theseus" -version = "0.2.0" +version = "0.2.1" authors = ["Jai A "] edition = "2018" diff --git a/theseus_cli/Cargo.toml b/theseus_cli/Cargo.toml index 6ef7fd90..2454ba87 100644 --- a/theseus_cli/Cargo.toml +++ b/theseus_cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "theseus_cli" -version = "0.2.0" +version = "0.2.1" authors = ["Jai A "] edition = "2018" diff --git a/theseus_gui/src-tauri/Cargo.toml b/theseus_gui/src-tauri/Cargo.toml index e93dfc13..0ee69e17 100644 --- a/theseus_gui/src-tauri/Cargo.toml +++ b/theseus_gui/src-tauri/Cargo.toml @@ -39,6 +39,7 @@ tracing-error = "0.1" sentry = "0.30" sentry-rust-minidump = "0.5" +[target.'cfg(not(target_os = "linux"))'.dependencies] window-shadows = "0.2.1" [target.'cfg(target_os = "macos")'.dependencies] diff --git a/theseus_gui/src-tauri/src/main.rs b/theseus_gui/src-tauri/src/main.rs index 9f81fdea..7082d23b 100644 --- a/theseus_gui/src-tauri/src/main.rs +++ b/theseus_gui/src-tauri/src/main.rs @@ -7,8 +7,6 @@ use theseus::prelude::*; use tauri::Manager; -use window_shadows::set_shadow; - use tracing_error::ErrorLayer; use tracing_subscriber::EnvFilter; @@ -86,11 +84,16 @@ fn main() { }) } - builder = builder.setup(|app| { - let win = app.get_window("main").unwrap(); - set_shadow(&win, true).unwrap(); - Ok(()) - }); + #[cfg(not(target_os = "linux"))] + { + use window_shadows::set_shadow; + + builder = builder.setup(|app| { + let win = app.get_window("main").unwrap(); + set_shadow(&win, true).unwrap(); + Ok(()) + }); + } #[cfg(target_os = "macos")] { diff --git a/theseus_gui/src-tauri/tauri.conf.json b/theseus_gui/src-tauri/tauri.conf.json index 439575f1..942c4038 100644 --- a/theseus_gui/src-tauri/tauri.conf.json +++ b/theseus_gui/src-tauri/tauri.conf.json @@ -8,7 +8,7 @@ }, "package": { "productName": "Modrinth App", - "version": "0.2.0" + "version": "0.2.1" }, "tauri": { "allowlist": { diff --git a/theseus_gui/src/components/ui/SearchCard.vue b/theseus_gui/src/components/ui/SearchCard.vue index cc751af6..3a95c376 100644 --- a/theseus_gui/src/components/ui/SearchCard.vue +++ b/theseus_gui/src/components/ui/SearchCard.vue @@ -77,7 +77,7 @@ import { import dayjs from 'dayjs' import relativeTime from 'dayjs/plugin/relativeTime' import { ref } from 'vue' -import { add_project_from_version as installMod, check_installed, list } from '@/helpers/profile.js' +import { add_project_from_version as installMod, list } from '@/helpers/profile.js' import { install as packInstall } from '@/helpers/pack.js' import { installVersionDependencies } from '@/helpers/utils.js' import { useFetch } from '@/helpers/fetch.js' @@ -118,12 +118,14 @@ const props = defineProps({ type: Boolean, default: false, }, + installed: { + type: Boolean, + default: false, + }, }) const installing = ref(false) -const installed = ref( - props.instance ? await check_installed(props.instance.path, props.project.project_id) : false -) +const installed = ref(props.installed) async function install() { installing.value = true diff --git a/theseus_gui/src/pages/Browse.vue b/theseus_gui/src/pages/Browse.vue index 6136940a..8bbd1c6d 100644 --- a/theseus_gui/src/pages/Browse.vue +++ b/theseus_gui/src/pages/Browse.vue @@ -688,6 +688,7 @@ const showLoaders = computed( :confirm-modal="confirmModal" :mod-install-modal="modInstallModal" :incompatibility-warning-modal="incompatibilityWarningModal" + :installed="result.installed" />